Documentation ¶
Overview ¶
Package types contains types that are common across libnetwork project
Index ¶
- Constants
- func CompareIPNet(a, b *net.IPNet) bool
- func ForbiddenErrorf(format string, params ...interface{}) error
- func GetBroadcastIP(ip net.IP, mask net.IPMask) (net.IP, error)
- func GetHostPartIP(ip net.IP, mask net.IPMask) (net.IP, error)
- func GetIPCopy(from net.IP) net.IP
- func GetIPNetCanonical(nw *net.IPNet) *net.IPNet
- func GetIPNetCopy(from *net.IPNet) *net.IPNet
- func GetMacCopy(from net.HardwareAddr) net.HardwareAddr
- func InternalErrorf(format string, params ...interface{}) error
- func InternalMaskableErrorf(format string, params ...interface{}) error
- func InvalidParameterErrorf(format string, params ...interface{}) error
- func IsIPNetValid(nw *net.IPNet) bool
- func NotFoundErrorf(format string, params ...interface{}) error
- func NotImplementedErrorf(format string, params ...interface{}) error
- func ParseCIDR(cidr string) (n *net.IPNet, e error)
- func UnavailableErrorf(format string, params ...interface{}) error
- type EncryptionKey
- type ForbiddenError
- type InterfaceStatistics
- type InternalError
- type InvalidParameterError
- type MaskableError
- type NotFoundError
- type NotImplementedError
- type PortBinding
- type Protocol
- type QosPolicy
- type StaticRoute
- type TransportPort
- type UnavailableError
Constants ¶
const ( IP = iota // IPv4 and IPv6 IPv4 IPv6 )
constants for the IP address type Deprecated: use the consts defined in github.com/docker/docker/libnetwork/resolvconf
const ( // ICMP is for the ICMP ip protocol ICMP = 1 // TCP is for the TCP ip protocol TCP = 6 // UDP is for the UDP ip protocol UDP = 17 // SCTP is for the SCTP ip protocol SCTP = 132 )
const ( // NEXTHOP indicates a StaticRoute with an IP next hop. NEXTHOP = iota // CONNECTED indicates a StaticRoute with an interface for directly connected peers. CONNECTED )
Variables ¶
This section is empty.
Functions ¶
func CompareIPNet ¶
CompareIPNet returns equal if the two IP Networks are equal
func ForbiddenErrorf ¶
ForbiddenErrorf creates an instance of ForbiddenError
func GetBroadcastIP ¶
GetBroadcastIP returns the broadcast ip address for the passed network (ip and mask). IP address representation is not modified. If address and mask are not compatible an error is returned.
func GetHostPartIP ¶
GetHostPartIP returns the host portion of the ip address identified by the mask. IP address representation is not modified. If address and mask are not compatible an error is returned.
func GetIPNetCanonical ¶
GetIPNetCanonical returns the canonical form for the passed network
func GetIPNetCopy ¶
GetIPNetCopy returns a copy of the passed IP Network
func GetMacCopy ¶
func GetMacCopy(from net.HardwareAddr) net.HardwareAddr
GetMacCopy returns a copy of the passed MAC address
func InternalErrorf ¶
InternalErrorf creates an instance of InternalError
func InternalMaskableErrorf ¶
InternalMaskableErrorf creates an instance of InternalError and MaskableError
func InvalidParameterErrorf ¶
InvalidParameterErrorf creates an instance of InvalidParameterError
func IsIPNetValid ¶
IsIPNetValid returns true if the ipnet is a valid network/mask combination. Otherwise returns false.
func NotFoundErrorf ¶
NotFoundErrorf creates an instance of NotFoundError
func NotImplementedErrorf ¶
NotImplementedErrorf creates an instance of NotImplementedError
func UnavailableErrorf ¶
UnavailableErrorf creates an instance of UnavailableError
Types ¶
type EncryptionKey ¶
EncryptionKey is the libnetwork representation of the key distributed by the lead manager.
type ForbiddenError ¶
type ForbiddenError interface {
// Forbidden makes implementer into ForbiddenError type
Forbidden()
}
ForbiddenError is an interface for errors which denote a valid request that cannot be honored
type InterfaceStatistics ¶
type InterfaceStatistics struct { RxBytes uint64 RxPackets uint64 RxErrors uint64 RxDropped uint64 TxBytes uint64 TxPackets uint64 TxErrors uint64 TxDropped uint64 }
InterfaceStatistics represents the interface's statistics
func (*InterfaceStatistics) String ¶
func (is *InterfaceStatistics) String() string
type InternalError ¶
type InternalError interface {
// Internal makes implementer into InternalError type
Internal()
}
InternalError is an interface for errors raised because of an internal error
type InvalidParameterError ¶
type InvalidParameterError interface {
// InvalidParameter makes implementer into InvalidParameterError type
InvalidParameter()
}
InvalidParameterError is an interface for errors originated by a bad request
type MaskableError ¶
type MaskableError interface {
// Maskable makes implementer into MaskableError type
Maskable()
}
MaskableError is an interface for errors which can be ignored by caller
type NotFoundError ¶
type NotFoundError interface {
// NotFound makes implementer into NotFoundError type
NotFound()
}
NotFoundError is an interface for errors raised because a needed resource is not available
type NotImplementedError ¶
type NotImplementedError interface {
// NotImplemented makes implementer into NotImplementedError type
NotImplemented()
}
NotImplementedError is an interface for errors raised because of requested functionality is not yet implemented
type PortBinding ¶
type PortBinding struct { Proto Protocol IP net.IP Port uint16 HostIP net.IP HostPort uint16 HostPortEnd uint16 }
PortBinding represents a port binding between the container and the host
func (PortBinding) ContainerAddr ¶
func (p PortBinding) ContainerAddr() (net.Addr, error)
ContainerAddr returns the container side transport address
func (*PortBinding) GetCopy ¶
func (p *PortBinding) GetCopy() PortBinding
GetCopy returns a copy of this PortBinding structure instance
func (PortBinding) HostAddr ¶
func (p PortBinding) HostAddr() (net.Addr, error)
HostAddr returns the host side transport address
func (PortBinding) String ¶
func (p PortBinding) String() string
String returns the PortBinding structure in the form "HostIP:HostPort:IP:Port/Proto", omitting un-set fields apart from Port.
type Protocol ¶
type Protocol uint8
Protocol represents an IP protocol number
func ParseProtocol ¶
ParseProtocol returns the respective Protocol type for the passed string
type QosPolicy ¶
type QosPolicy struct {
MaxEgressBandwidth uint64
}
QosPolicy represents a quality of service policy on an endpoint
type StaticRoute ¶
type StaticRoute struct { Destination *net.IPNet RouteType int // NEXT_HOP or CONNECTED // NextHop will be resolved by the kernel (i.e. as a loose hop). NextHop net.IP }
StaticRoute is a statically-provisioned IP route.
func (*StaticRoute) GetCopy ¶
func (r *StaticRoute) GetCopy() *StaticRoute
GetCopy returns a copy of this StaticRoute structure
type TransportPort ¶
TransportPort represents a local Layer 4 endpoint
func (*TransportPort) Equal ¶
func (t *TransportPort) Equal(o *TransportPort) bool
Equal checks if this instance of TransportPort is equal to the passed one
func (*TransportPort) GetCopy ¶
func (t *TransportPort) GetCopy() TransportPort
GetCopy returns a copy of this TransportPort structure instance
func (*TransportPort) String ¶
func (t *TransportPort) String() string
String returns the TransportPort structure in string form
type UnavailableError ¶
type UnavailableError interface {
Unavailable()
}UnavailableError is an interface for errors returned when the required service is not available