id

package
v1.5.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allocate

func Allocate() uint16

Allocate returns a new random ID from the pool

func NewCiliumID

func NewCiliumID(id int64) string

NewCiliumID returns a new endpoint identifier of type CiliumLocalIdPrefix

func NewID

func NewID(prefix PrefixType, id string) string

NewID returns a new endpoint identifier

func NewIPPrefixID

func NewIPPrefixID(ip net.IP) string

NewIPPrefixID returns an identifier based on the IP address specified

func ParseCiliumID

func ParseCiliumID(id string) (int64, error)

ParseCiliumID parses id as cilium endpoint id and returns numeric portion.

func ReallocatePool

func ReallocatePool()

ReallocatePool starts over with a new pool.

func Release

func Release(id uint16) error

Release releases an endpoint ID that was previously allocated or reused

func Reuse

func Reuse(id uint16) error

Reuse grabs a specific endpoint ID for reuse. This can be used when restoring endpoints.

Types

type PrefixType

type PrefixType string

PrefixType describes the type of endpoint identifier

const (
	// CiliumLocalIdPrefix is a numeric identifier with local scope. It has
	// no cluster wide meaning and is only unique in the scope of a single
	// agent. An endpoint is guaranteed to always have a local scope identifier.
	CiliumLocalIdPrefix PrefixType = "cilium-local"

	// CiliumGlobalIdPrefix is an endpoint identifier with global scope.
	// This addressing mechanism is currently unused.
	CiliumGlobalIdPrefix PrefixType = "cilium-global"

	// ContainerIdPrefix is used to address an endpoint via its primary
	// container ID. The container ID is specific to the container runtime
	// in use. Only the primary container that defines the networking scope
	// can be used to address an endpoint.
	ContainerIdPrefix PrefixType = "container-id"

	// DockerEndpointPrefix is used to address an endpoint via the Docker
	// endpoint ID. This method is only possible if the endpoint was
	// created via the cilium-docker plugin and the container is backed by
	// the libnetwork abstraction.
	DockerEndpointPrefix PrefixType = "docker-endpoint"

	// ContainerNamePrefix is used to address the endpoint via the
	// container's name. This addressing mechanism depends on the container
	// runtime. Only the primary container that the networking scope can be
	// used to address an endpoint.
	ContainerNamePrefix PrefixType = "container-name"

	// PodNamePrefix is used to address an endpoint via the Kubernetes pod
	// name. This addressing only works if the endpoint represents as
	// Kubernetes pod.
	PodNamePrefix PrefixType = "pod-name"

	// IPv4Prefix is used to address an endpoint via the endpoint's IPv4
	// address.
	IPv4Prefix PrefixType = "ipv4"

	// IPv6Prefix is the prefix used to refer to an endpoint via IPv6 address
	IPv6Prefix PrefixType = "ipv6"
)

func Parse

func Parse(id string) (PrefixType, string, error)

Parse parses a string as an endpoint identified consists of an optional prefix [prefix:] followed by the identifier.

func (PrefixType) String

func (s PrefixType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL