Documentation ¶
Index ¶
- Constants
- func ListAll(system uint8) (map[NS]PortMap, error)
- func RemoveAll(ns NS) error
- func RemovePortForward(ns NS, host string, dest int) error
- func Resolve(address string) string
- func ResolveURL(raw string) (string, error)
- func SetPortForward(ns NS, ip string, host string, dest int) error
- func ValidHost(host string) bool
- type API
- type NS
- type PortMap
Constants ¶
View Source
const ( //Container system Container uint8 = iota + 1 //KVM system KVM )
Variables ¶
This section is empty.
Functions ¶
func RemovePortForward ¶
RemovePortForward removes a single port forward
func Resolve ¶ added in v1.5.0
Resolve resolves an address of the form <ip>:<port> to a direct address to the endpoint IF - the ip address is a local address of this machine - port has a forwarding rule ELSE - return address unchanged
func ResolveURL ¶ added in v1.5.0
ResolveURL rewrites a url to a direct address to the end point. Return original url if no forwarding rule configured that matches the given address note, the url host part must be an ip, can't use host names
func SetPortForward ¶
SetPortForward create a single port forward from host(port), to ip(addr) and dest(port) in this namespace The namespace is used to group port forward rules so they all can get terminated with one call later.
Types ¶
type API ¶ added in v1.5.0
type API interface { SetPortForward(ns NS, ip string, host string, dest int) error RemovePortForward(ns NS, host string, dest int) error RemoveAll(ns NS) error List(ns NS) (PortMap, error) ListAll(system uint8) (map[NS]PortMap, error) Resolve(address string) string ResolveURL(raw string) (string, error) ValidHost(host string) bool }
Click to show internal directories.
Click to hide internal directories.