Documentation
¶
Index ¶
- type ErrHandler
- type Info
- type InfoProxyHandler
- type ListProxyHandler
- type ModProxyHandler
- type Proxy
- func (p *Proxy) AddErrHandler(h ErrHandler) error
- func (p *Proxy) AddInfoProxyHandler(h InfoProxyHandler) error
- func (p *Proxy) AddListProxy(h ListProxyHandler) error
- func (p *Proxy) AddModProxyHandler(h ModProxyHandler) error
- func (p *Proxy) AddZipProxyHandler(h ZipProxyHandler) error
- func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type ProxyClient
- type ZipProxyHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrHandler ¶
type ErrHandler func(w http.ResponseWriter, r *http.Request, err error)
ErrHandler represents handler for handling error
type InfoProxyHandler ¶
InfoProxyHandler represents proxy handler for /@latest and /@v/v0.0.1.info info receieves information of the go release version.
type ListProxyHandler ¶
ListProxyHandler represents proxy handler for /@v/list versionList receieves list of the go release version which is following semantic versioning.
type ModProxyHandler ¶
ModProxyHandler represents proxy handler for /@v/v0.0.1.mod body receieves mod file. body will close file descripter at outside of the handler.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy proxies to GOPROXY of upstream. this struct is satisfied http.Handler.
func NewProxy ¶
func NewProxy(c ProxyClient, upstreamGoProxyHost string) (*Proxy, error)
NewProxy makes proxy of the GOPROXY. returns Proxy struct which is satisfied http.Handler.
func (*Proxy) AddErrHandler ¶
func (p *Proxy) AddErrHandler(h ErrHandler) error
AddErrHandler registers error handler
func (*Proxy) AddInfoProxyHandler ¶
func (p *Proxy) AddInfoProxyHandler(h InfoProxyHandler) error
AddInfoProxyHandler registers proxy handler for /@latest and /@v/v0.0.1.info
func (*Proxy) AddListProxy ¶
func (p *Proxy) AddListProxy(h ListProxyHandler) error
AddListProxy registers proxy handler for /@v/list
func (*Proxy) AddModProxyHandler ¶
func (p *Proxy) AddModProxyHandler(h ModProxyHandler) error
AddModProxyHandler registers proxy handler for /@v/v0.0.1.mod
func (*Proxy) AddZipProxyHandler ¶
func (p *Proxy) AddZipProxyHandler(h ZipProxyHandler) error
AddZipProxyHandler registers proxy handler for /@v/v0.0.1.zip
type ProxyClient ¶
ProxyClient interface represents http client. http.Client is satisfied this interface.
type ZipProxyHandler ¶
ZipProxyHandler represents proxy handler for /@v/v0.0.1.zip body receieves zip file. body will close file descripter at outside of the handler.