Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { Address string // e.g. "host:port" or ":port" for localhost port ReverseProxy *httputil.ReverseProxy }
Host represents a target host of a proxy
type HostManager ¶
type HostManager interface { PutHost(sni string, addr string, rp *httputil.ReverseProxy) error GetHost(sni string) (*Host, bool, error) RemoveHost(sni string) error }
HostManager represents the host-management functionality required of a multiple-host proxy
type InMemoryHostManager ¶
type InMemoryHostManager struct { sync.RWMutex // inherit read/write lock behavior // contains filtered or unexported fields }
InMemoryHostManager is an in-memory implementation of the HostManager iface
func NewInMemoryHostManager ¶
func NewInMemoryHostManager() *InMemoryHostManager
NewInMemoryHostManager is the InMemoryHostManager constructor
func (*InMemoryHostManager) GetHost ¶
func (s *InMemoryHostManager) GetHost(sni string) (*Host, bool, error)
GetHost looks-up the target host for a given server name
func (*InMemoryHostManager) PutHost ¶
func (s *InMemoryHostManager) PutHost( sni string, addr string, rp *httputil.ReverseProxy, ) error
PutHost adds/updates the target host for a given server name
func (*InMemoryHostManager) RemoveHost ¶
func (s *InMemoryHostManager) RemoveHost(sni string) error
RemoveHost removes the target host for a given server name
Click to show internal directories.
Click to hide internal directories.