Documentation ¶
Index ¶
- Constants
- Variables
- func WithCluster(ctx context.Context, cluster Name) context.Context
- type Name
- func (n Name) Base() string
- func (n Name) Empty() bool
- func (n Name) HasPrefix(other Name) bool
- func (n Name) IsValid() bool
- func (n Name) Join(name string) Name
- func (n Name) MarshalJSON() ([]byte, error)
- func (n Name) Parent() (Name, bool)
- func (n Name) Path() string
- func (n Name) Split() (parent Name, name string)
- func (n Name) String() string
- func (n *Name) UnmarshalJSON(data []byte) error
- type Object
Constants ¶
const ClusterHeader = "X-Kubernetes-Cluster"
ClusterHeader set to "<lcluster>" on a request is an alternative to accessing the cluster via /clusters/<lcluster>. With that the <lcluster> can be access via normal kube-like /api and /apis endpoints.
Variables ¶
var ( // Wildcard is the name indicating cross-workspace requests. Wildcard = New("*") )
Functions ¶
Types ¶
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
Name is the name of a logical cluster. A logical cluster is
- a (part of) etcd prefix to store objects in that cluster
- a (part of) a http path which serves a Kubernetes-cluster-like API with discovery, OpenAPI and the actual API groups.
- a value in metadata.clusterName in objects from cross-workspace list/watches, which is used to identify the logical cluster.
A logical cluster is a colon separated list of words. In other words, it is like a path, but with colons instead of slashes.
func ClusterFromContext ¶ added in v1.1.1
ClusterFromContext extracts a cluster name from the context
func NewValidated ¶ added in v1.1.0
NewValidated returns a Name from a string and whether it is a valid logical cluster. A valid logical cluster returns true on IsValid().
func (Name) IsValid ¶ added in v1.1.0
IsValid returns true if the name is a Wildcard or a colon separated list of words where each word starts with a lower-case letter and contains only lower-case letters, digits and hyphens.
func (Name) MarshalJSON ¶
func (Name) Parent ¶
Parent returns the parent logical cluster name of the given logical cluster name.
func (Name) Split ¶
Split splits logical cluster immediately following the final colon, separating it into a parent logical cluster and name component. If there is no colon in path, Split returns an empty logical cluster name and name set to path.