Documentation
¶
Index ¶
- Variables
- type Gateway
- func (g *Gateway) Add(vhost string, uri *url.URL) error
- func (g *Gateway) Close() error
- func (g *Gateway) Exists(vhost string) bool
- func (s *Gateway) List() []Host
- func (g *Gateway) Remove(vhost string) error
- func (g *Gateway) RemoveByURI(uri *URI) error
- func (g *Gateway) Replace(vhost string, uri *url.URL) error
- func (g *Gateway) Wait()
- type Host
- type Option
- type URI
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a virtual host is not found. ErrNotFound = errors.New("vhost not found") // ErrAlreadyExists is returned when a virtual host already exists. ErrAlreadyExists = errors.New("vhost address already in use") )
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a virtual host reverse proxy server. Zero value is not usable.
func (*Gateway) RemoveByURI ¶ added in v0.0.4
RemoveByURI removes the virtual host from the server by URI.
type Host ¶
type Host struct {
// Name is the name of the Virtual Host.
Name string `json:"name"`
// URI is the URI of the target HTTP server.
URI *URI `json:"uri"`
}
Host is a single Virtual Host.
type Option ¶
type Option func(*options)
Option is a functional option for the server.
func WithTimeout ¶
WithTimeout sets the connection timeout to the virtual hosts.
type URI ¶ added in v0.0.4
URI is a wrapper around pkg/net/url.URL that implements custom json.Marshaler and json.Unmarshaler.
func Parse ¶ added in v0.0.4
Parse is a wrapper around pkg/url.Parse.
func (*URI) MarshalJSON ¶ added in v0.0.4
func (*URI) UnmarshalJSON ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.