package altsvc

import (
	
	
)

// AltSvcJar is default implementation of Jar, which stores
// AltSvc in memory.
type AltSvcJar struct {
	entries map[string]*AltSvc
	mu      sync.Mutex
}

// NewAltSvcJar create a AltSvcJar which implements Jar.
func () *AltSvcJar {
	return &AltSvcJar{
		entries: make(map[string]*AltSvc),
	}
}

func ( *AltSvcJar) ( string) *AltSvc {
	if  == "" {
		return nil
	}
	,  := .entries[]
	if ! {
		return nil
	}
	 := time.Now()
	.mu.Lock()
	defer .mu.Unlock()
	if .Expire.Before() { // expired
		delete(.entries, )
		return nil
	}
	return 
}

func ( *AltSvcJar) ( string,  *AltSvc) {
	if  == "" {
		return
	}
	.mu.Lock()
	defer .mu.Unlock()
	.entries[] = 
}

// AltSvc is the parsed alt-svc.
type AltSvc struct {
	// Protocol is the alt-svc proto, e.g. h3.
	Protocol string
	// Host is the alt-svc's host, could be empty if
	// it's the same host as the raw request.
	Host string
	// Port is the alt-svc's port.
	Port string
	// Expire is the time that the alt-svc should expire.
	Expire time.Time
}