Documentation
¶
Overview ¶
Package for declaring types that will be used by various other packages. This is useful for preventing import cycles. For example, pkg/pods depends on pkg/auth. If both wish to use pods.ID, an import cycle is created.
Index ¶
- Constants
- Variables
- func HomeToPodUUID(home string) *uuid.UUID
- type NodeName
- type NodeSet
- func (n NodeSet) DeleteNode(node NodeName)
- func (n NodeSet) Difference(other NodeSet) NodeSet
- func (n NodeSet) Equal(other NodeSet) bool
- func (n NodeSet) InsertNode(node NodeName)
- func (n NodeSet) Intersection(other NodeSet) NodeSet
- func (n NodeSet) ListNodes() []NodeName
- func (n NodeSet) PopAny() (NodeName, bool)
- type PodID
- type PodLocation
- type PodLocations
- type PodUniqueKey
Constants ¶
const ( AvailabilityZoneLabel = "availability_zone" ClusterNameLabel = "cluster_name" PodIDLabel = "pod_id" )
const (
PodUUIDLength int = 36
)
Variables ¶
var InvalidUUID = errors.New("does not parse as a uuid")
Functions ¶
func HomeToPodUUID ¶
Types ¶
type NodeSet ¶
Wraps sets.String to provide the functionality of a set when dealing with the NodeName type (which is a string)
func NewNodeSet ¶
func (NodeSet) DeleteNode ¶
func (NodeSet) Difference ¶
func (NodeSet) InsertNode ¶
func (NodeSet) Intersection ¶
type PodID ¶
type PodID string
Refers to the id: key in a pod manifest, i.e. the name of the application running in the pod. There may be multiple copies (pods) of a given pod id running at a given time
type PodLocation ¶
type PodLocations ¶
type PodLocations []PodLocation
func (PodLocations) Nodes ¶
func (l PodLocations) Nodes() []NodeName
Nodes returns a list of just the locations' nodes.
type PodUniqueKey ¶
type PodUniqueKey string // empty for legacy pods, uuid otherwise
A unique identifier for each pod (instance) expressed as a UUID. Supporting UUIDs is a new feature, so typically it will be empty. An empty PodUniqueKey signifies a legacy pod for which there is no uuid.
P2 will begin using uuids instead of the previous format to better support running multiple pods with the same pod id on the same node. Certain new functionality will only be supported for pods with UUID unique keys, hence the need for checking for non-nil values.
func NewPodUUID ¶
func NewPodUUID() PodUniqueKey
func ToPodUniqueKey ¶
func ToPodUniqueKey(podUniqueKeyStr string) (PodUniqueKey, error)
Turns a string into a PodUniqueKey iff the string properly parses as a UUID
func (PodUniqueKey) String ¶
func (p PodUniqueKey) String() string