Documentation ¶
Index ¶
- Variables
- func AdhocResolveHost(hostStr string, replace *pb.Adhoc_Replace) (string, error)
- func ExtractHostPort(hostStr string) (hostName string, port int, err error)
- func HostMatches(host string, matcher string) bool
- func NewDynamic(add Addresser) *dynamic
- func PortAllowed(port int, portRule *pb.Adhoc_Port) bool
- type Addresser
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultALookup is the lookup resolver for DNS A records. // You can override it for caching or testing. DefaultALookup = net.LookupHost )
Functions ¶
func AdhocResolveHost ¶
func AdhocResolveHost(hostStr string, replace *pb.Adhoc_Replace) (string, error)
func HostMatches ¶
func NewDynamic ¶
func NewDynamic(add Addresser) *dynamic
NewDynamic creates a new dynamic router that can be have its routes updated.
func PortAllowed ¶
func PortAllowed(port int, portRule *pb.Adhoc_Port) bool
Types ¶
type Addresser ¶
type Addresser interface { // Address decides the ip:port to send the request to, if any. Errors may be returned if permission is denied. // The returned string must contain contain both ip and port separated by colon. Address(hostString string) (string, error) }
Addresser implements logic that decides what "ad-hoc" ip:port to dial for a backend, if any.
Adhoc rules are a way of forwarding requests to services that fall outside of pre-defined Routes and Backends.
Click to show internal directories.
Click to hide internal directories.