Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
Addr contains ip and port.
type Container ¶
type Container struct { ID string Name string Platform ContainerPlatform Labels map[string]string Networks []ContainerNetwork PortBindings map[Port][]Port }
Container contains meta data of a container.
type ContainerEvent ¶
type ContainerEvent struct { Type ContainerEventType Container Container Error error }
ContainerEvent contains event type and subject container meta data.
type ContainerEventType ¶
type ContainerEventType int
ContainerEventType represents container lifecycle events, such as "created".
const ( ContainerEventCreated ContainerEventType = iota ContainerEventDestroyed )
Enum values of ContainerEventType.
type ContainerNetwork ¶
type ContainerNetwork struct {
Name string
}
ContainerNetwork contains meta data of a container network.
type ContainerPlatform ¶
type ContainerPlatform int
ContainerPlatform represents each container implementation, such as "docker".
const ( ContainerPlatformUnknown ContainerPlatform = iota ContainerPlatformDocker )
Enum values of ContainerPlatform.
func (ContainerPlatform) String ¶
func (p ContainerPlatform) String() string
type ContainerRepository ¶
type ContainerRepository interface {
ListenEvent(context.Context) (<-chan ContainerEvent, <-chan error)
}
ContainerRepository is an interface for accessing containers.
type Mapping ¶
type Mapping struct { Host string `json:"host"` PortAddrMap PortAddrMap `json:"map"` }
Mapping represents <hostname>:<port> - <local IP>:<port> map.
type MappingEvent ¶
type MappingEvent struct { Type MappingEventType Mapping }
MappingEvent contains event type and subject mapping.
type MappingEventType ¶
type MappingEventType int
MappingEventType represents mapping lifecycle events, such as "created".
const ( MappingEventCreated MappingEventType = iota MappingEventDestroyed )
Enum values of MappingEventType.
type MappingRepository ¶
type MappingRepository interface { List(ctx context.Context) ([]*Mapping, error) HasHost(ctx context.Context, host string) (bool, error) MapAddr(ctx context.Context, addr Addr) (Addr, error) Create(ctx context.Context, mapping *Mapping) error DeleteByHost(ctx context.Context, host string) error ListenEvent(ctx context.Context) (<-chan MappingEvent, <-chan error) }
MappingRepository is an interface for accessing <hostname>-<port> mappings.
type Port ¶
type Port uint16
Port represents port number.
func PortFromString ¶
PortFromString returns a Port object from the given string.