Documentation ¶
Overview ¶
Package types contains types that are common across libnetwork project
Index ¶
- Constants
- func BadRequestErrorf(format string, params ...interface{}) error
- func CompareIPNet(a, b *net.IPNet) bool
- func ForbiddenErrorf(format string, params ...interface{}) error
- func GetIPCopy(from net.IP) net.IP
- 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 NoServiceErrorf(format string, params ...interface{}) error
- func NotFoundErrorf(format string, params ...interface{}) error
- func NotImplementedErrorf(format string, params ...interface{}) error
- func RetryErrorf(format string, params ...interface{}) error
- func TimeoutErrorf(format string, params ...interface{}) error
- type BadRequestError
- type ErrInvalidProtocolBinding
- type ForbiddenError
- type InternalError
- type MaskableError
- type NoServiceError
- type NotFoundError
- type NotImplementedError
- type PortBinding
- type Protocol
- type RetryError
- type StaticRoute
- type TimeoutError
- type TransportPort
- type UUID
Constants ¶
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 )
const ( // NEXTHOP indicates a StaticRoute with an IP next hop. NEXTHOP = iota // CONNECTED indicates a StaticRoute with a interface for directly connected peers. CONNECTED )
Variables ¶
This section is empty.
Functions ¶
func BadRequestErrorf ¶
BadRequestErrorf creates an instance of BadRequestError
func CompareIPNet ¶
CompareIPNet returns equal if the two IP Networks are equal
func ForbiddenErrorf ¶
ForbiddenErrorf creates an instance of ForbiddenError
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 NoServiceErrorf ¶
NoServiceErrorf creates an instance of NoServiceError
func NotFoundErrorf ¶
NotFoundErrorf creates an instance of NotFoundError
func NotImplementedErrorf ¶
NotImplementedErrorf creates an instance of NotImplementedError
func RetryErrorf ¶
RetryErrorf creates an instance of RetryError
func TimeoutErrorf ¶
TimeoutErrorf creates an instance of TimeoutError
Types ¶
type BadRequestError ¶
type BadRequestError interface {
// BadRequest makes implementer into BadRequestError type
BadRequest()
}
BadRequestError is an interface for errors originated by a bad request
type ErrInvalidProtocolBinding ¶
type ErrInvalidProtocolBinding string
ErrInvalidProtocolBinding is returned when the port binding protocol is not valid.
func (ErrInvalidProtocolBinding) Error ¶
func (ipb ErrInvalidProtocolBinding) Error() string
type ForbiddenError ¶
type ForbiddenError interface {
// Forbidden makes implementer into ForbiddenError type
Forbidden()
}
ForbiddenError is an interface for errors which denote an valid request that cannot be honored
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 MaskableError ¶
type MaskableError interface {
// Maskable makes implementer into MaskableError type
Maskable()
}
MaskableError is an interface for errors which can be ignored by caller
type NoServiceError ¶
type NoServiceError interface {
// NoService makes implementer into NoServiceError type
NoService()
}
NoServiceError is an interface for errors returned when the required service is not available
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 ¶
PortBinding represent 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) Equal ¶
func (p *PortBinding) Equal(o *PortBinding) bool
Equal checks if this instance of PortBinding is equal to the passed one
func (*PortBinding) GetCopy ¶
func (p *PortBinding) GetCopy() PortBinding
GetCopy returns a copy of this PortBinding structure instance
type Protocol ¶
type Protocol uint8
Protocol represents a IP protocol number
func ParseProtocol ¶
ParseProtocol returns the respective Protocol type for the passed string
type RetryError ¶
type RetryError interface {
// Retry makes implementer into RetryError type
Retry()
}
RetryError is an interface for errors which might get resolved through retry
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 // InterfaceID must refer to a defined interface on the // Endpoint to which the routes are specified. Routes specified this way // are interpreted as directly connected to the specified interface (no // next hop will be used). InterfaceID int }
StaticRoute is a statically-provisioned IP route.
func (*StaticRoute) GetCopy ¶
func (r *StaticRoute) GetCopy() *StaticRoute
GetCopy returns a copy of this StaticRoute structure
type TimeoutError ¶
type TimeoutError interface {
// Timeout makes implementer into TimeoutError type
Timeout()
}
TimeoutError is an interface for errors raised because of timeout
type TransportPort ¶
TransportPort represent a local Layer 4 endpoint
func (*TransportPort) GetCopy ¶
func (t *TransportPort) GetCopy() TransportPort
GetCopy returns a copy of this TransportPort structure instance