Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidServiceID = errors.New("invalid service ID") LegacyServiceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$") // The namespace and name components are (apparently // non-normatively) defined in // https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md // In practice, more punctuation is used than allowed there; // specifically, people use underscores as well as dashes and dots, and in names, colons. IDRegexp = regexp.MustCompile("^(<cluster>|[a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)/([a-zA-Z0-9_.:-]+)$") UnqualifiedIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_.:-]+)$") )
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID is an opaque type which uniquely identifies a resource in an orchestrator.
func MustParseID ¶
MustParseID constructs a ID from a string representation, panicing if the format is invalid.
func ParseID ¶
ParseID constructs a ID from a string representation if possible, returning an error value otherwise.
func ParseIDOptionalNamespace ¶
ParseIDOptionalNamespace constructs a ID from either a fully qualified string representation, or an unqualified kind/name representation and the supplied namespace.
func (ID) Components ¶
Components returns the constituent components of a ID
func (ID) MarshalJSON ¶
MarshalJSON encodes a ID as a JSON string. This is done to maintain backwards compatibility with previous flux versions where the ID is a plain string.
func (ID) MarshalText ¶
MarshalText encodes a ID as a flat string; this is required because ResourceIDs are sometimes used as map keys.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON decodes a ID from a JSON string. This is done to maintain backwards compatibility with previous flux versions where the ID is a plain string.
func (*ID) UnmarshalText ¶
MarshalText decodes a ID from a flat string; this is required because ResourceIDs are sometimes used as map keys.