Documentation ¶
Index ¶
- type Metadata
- func (m *Metadata) CheckAndSetDefaults() error
- func (m *Metadata) Expiry() time.Time
- func (m *Metadata) GetAllLabels() map[string]string
- func (m *Metadata) GetLabel(key string) (string, bool)
- func (m *Metadata) GetName() string
- func (m *Metadata) GetRevision() string
- func (m *Metadata) GetStaticLabels() map[string]string
- func (m *Metadata) IsEqual(i *Metadata) bool
- func (m *Metadata) Origin() string
- func (m *Metadata) SetExpiry(expires time.Time)
- func (m *Metadata) SetName(name string)
- func (m *Metadata) SetOrigin(origin string)
- func (m *Metadata) SetRevision(rev string)
- func (m *Metadata) SetStaticLabels(sl map[string]string)
- type ResourceHeader
- func (h *ResourceHeader) CheckAndSetDefaults() error
- func (h *ResourceHeader) Expiry() time.Time
- func (h *ResourceHeader) GetAllLabels() map[string]string
- func (h *ResourceHeader) GetKind() string
- func (h *ResourceHeader) GetLabel(key string) (string, bool)
- func (h *ResourceHeader) GetMetadata() Metadata
- func (h *ResourceHeader) GetName() string
- func (h *ResourceHeader) GetRevision() string
- func (h *ResourceHeader) GetStaticLabels() map[string]string
- func (h *ResourceHeader) GetSubKind() string
- func (h *ResourceHeader) GetVersion() string
- func (h *ResourceHeader) IsEqual(i *ResourceHeader) bool
- func (h *ResourceHeader) Origin() string
- func (h *ResourceHeader) SetExpiry(t time.Time)
- func (h *ResourceHeader) SetKind(kind string)
- func (h *ResourceHeader) SetName(v string)
- func (h *ResourceHeader) SetOrigin(origin string)
- func (h *ResourceHeader) SetRevision(rev string)
- func (h *ResourceHeader) SetStaticLabels(sl map[string]string)
- func (h *ResourceHeader) SetSubKind(s string)
- func (h *ResourceHeader) SetVersion(version string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct { // Name is an object name Name string `json:"name" yaml:"name"` // Description is object description Description string `json:"description,omitempty" yaml:"description,omitempty"` // Labels is a set of labels Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` // Expires is a global expiry time header can be set on any resource in the system. Expires time.Time `json:"expires" yaml:"expires"` // Revision is an opaque identifier which tracks the versions of a resource // over time. Clients should ignore and not alter its value but must return // the revision in any updates of a resource. Revision string `json:"revision,omitempty" yaml:"revision,omitempty"` }
Metadata is resource metadata
func (*Metadata) CheckAndSetDefaults ¶
CheckAndSetDefaults verifies that the metadata object is valid.
func (*Metadata) GetAllLabels ¶
GetAllLabels returns all labels from the resource.
func (*Metadata) GetLabel ¶
GetLabel retrieves the label with the provided key. If not found value will be empty and ok will be false.
func (*Metadata) GetRevision ¶
GetRevision returns the revision
func (*Metadata) GetStaticLabels ¶
GetStaticLabels returns the static labels for the metadata.
func (*Metadata) IsEqual ¶
IsEqual determines if two metadata resources are equivalent to one another.
func (*Metadata) SetRevision ¶
SetRevision sets the revision
func (*Metadata) SetStaticLabels ¶
SetStaticLabels sets the static labels for the metadata.
type ResourceHeader ¶
type ResourceHeader struct { // Kind is a resource kind. Kind string `json:"kind,omitempty"` // SubKind is an optional resource sub kind, used in some resources. SubKind string `json:"sub_kind,omitempty"` // Version is the resource version. Version string `json:"version,omitempty"` // Metadata is metadata for the resource. Metadata Metadata `json:"metadata,omitempty"` }
ResourceHeader is a common header for Teleport resources.
func ResourceHeaderFromMetadata ¶
func ResourceHeaderFromMetadata(metadata Metadata) ResourceHeader
func (*ResourceHeader) CheckAndSetDefaults ¶
func (h *ResourceHeader) CheckAndSetDefaults() error
CheckAndSetDefaults will verify that the resource header is valid. This will additionally verify that the metadata is valid.
func (*ResourceHeader) Expiry ¶
func (h *ResourceHeader) Expiry() time.Time
Expiry returns the resource expiry setting.
func (*ResourceHeader) GetAllLabels ¶
func (h *ResourceHeader) GetAllLabels() map[string]string
GetAllLabels returns all labels from the resource.
func (*ResourceHeader) GetKind ¶
func (h *ResourceHeader) GetKind() string
GetKind returns the resource kind.
func (*ResourceHeader) GetLabel ¶
func (h *ResourceHeader) GetLabel(key string) (string, bool)
GetLabel retrieves the label with the provided key. If not found value will be empty and ok will be false.
func (*ResourceHeader) GetMetadata ¶
func (h *ResourceHeader) GetMetadata() Metadata
GetMetadata returns object metadata.
func (*ResourceHeader) GetName ¶
func (h *ResourceHeader) GetName() string
GetName returns the name of the resource.
func (*ResourceHeader) GetRevision ¶
func (h *ResourceHeader) GetRevision() string
GetRevision returns the revision.
func (*ResourceHeader) GetStaticLabels ¶
func (h *ResourceHeader) GetStaticLabels() map[string]string
GetStaticLabels returns the static labels for the resource.
func (*ResourceHeader) GetSubKind ¶
func (h *ResourceHeader) GetSubKind() string
GetSubKind returns the resource subkind.
func (*ResourceHeader) GetVersion ¶
func (h *ResourceHeader) GetVersion() string
GetVersion returns the resource version.
func (*ResourceHeader) IsEqual ¶
func (h *ResourceHeader) IsEqual(i *ResourceHeader) bool
IsEqual determines if two resource headers are equivalent to one another.
func (*ResourceHeader) Origin ¶
func (h *ResourceHeader) Origin() string
Origin returns the origin value of the resource.
func (*ResourceHeader) SetExpiry ¶
func (h *ResourceHeader) SetExpiry(t time.Time)
SetExpiry sets the resource expiry.
func (*ResourceHeader) SetKind ¶
func (h *ResourceHeader) SetKind(kind string)
SetKind sets the resource kind.
func (*ResourceHeader) SetName ¶
func (h *ResourceHeader) SetName(v string)
SetName sets the name of the resource.
func (*ResourceHeader) SetOrigin ¶
func (h *ResourceHeader) SetOrigin(origin string)
SetOrigin sets the origin value of the resource.
func (*ResourceHeader) SetRevision ¶
func (h *ResourceHeader) SetRevision(rev string)
SetRevision sets the revision.
func (*ResourceHeader) SetStaticLabels ¶
func (h *ResourceHeader) SetStaticLabels(sl map[string]string)
SetStaticLabels sets the static labels for the resource.
func (*ResourceHeader) SetSubKind ¶
func (h *ResourceHeader) SetSubKind(s string)
SetSubKind sets the resource subkind.
func (*ResourceHeader) SetVersion ¶
func (h *ResourceHeader) SetVersion(version string)
SetVersion sets the resource version.