Documentation
¶
Index ¶
- Constants
- func Construct(namespace string, name string) string
- func GroupKindToSchemaID(kind schema.GroupKind) string
- func Parse(ref string) (namespace string, name string)
- type AnnotationSchemaOwners
- func (o AnnotationSchemaOwners) Add(ownerGK schema.GroupKind, owner metav1.Object) bool
- func (o AnnotationSchemaOwners) Bind(obj metav1.Object) error
- func (o AnnotationSchemaOwners) Has(ownerGK schema.GroupKind, owner metav1.Object) bool
- func (o AnnotationSchemaOwners) List(ownerGK schema.GroupKind) []string
- func (o AnnotationSchemaOwners) MarshalJSON() ([]byte, error)
- func (o AnnotationSchemaOwners) Remove(ownerGK schema.GroupKind, owner metav1.Object) bool
- func (o AnnotationSchemaOwners) String() string
- func (o *AnnotationSchemaOwners) UnmarshalJSON(bytes []byte) error
- type AnnotationSchemaReference
- type AnnotationSchemaReferences
Constants ¶
const (
AnnotationSchemaOwnerKeyName = "harvesterhci.io/owned-by"
)
Variables ¶
This section is empty.
Functions ¶
func GroupKindToSchemaID ¶
GroupKindToSchemaID translate the GroupKind to steve schema ID.
Types ¶
type AnnotationSchemaOwners ¶
type AnnotationSchemaOwners map[string]AnnotationSchemaReference
AnnotationSchemaOwners structures the value recorded in "harvesterhci.io/owned-by" annotation.
func GetSchemaOwnersFromAnnotation ¶
func GetSchemaOwnersFromAnnotation(obj metav1.Object) (AnnotationSchemaOwners, error)
GetSchemaOwnersFromAnnotation gets the annotation schema owners from resource.
func (AnnotationSchemaOwners) Add ¶
Add adds the given owner as an annotation schema owner, returns false to indicate that the ownerRef was a reference.
func (AnnotationSchemaOwners) Bind ¶
func (o AnnotationSchemaOwners) Bind(obj metav1.Object) error
Bind bind the schema owners to given object's annotation.
func (AnnotationSchemaOwners) List ¶
func (o AnnotationSchemaOwners) List(ownerGK schema.GroupKind) []string
List returns the owner's name list by given group kind.
func (AnnotationSchemaOwners) MarshalJSON ¶
func (o AnnotationSchemaOwners) MarshalJSON() ([]byte, error)
func (AnnotationSchemaOwners) Remove ¶
Remove remove the given owner from the annotation schema owners, returns false to indicate that the ownerRef isn't a reference.
func (AnnotationSchemaOwners) String ¶
func (o AnnotationSchemaOwners) String() string
func (*AnnotationSchemaOwners) UnmarshalJSON ¶
func (o *AnnotationSchemaOwners) UnmarshalJSON(bytes []byte) error
type AnnotationSchemaReference ¶
type AnnotationSchemaReference struct { // SchemaID represents the ID of steve schema API. SchemaID string `json:"schema"` // References stores the steve data ID of the owners. References AnnotationSchemaReferences `json:"refs,omitempty"` }
AnnotationSchemaReference represents the owners with same schema ID.
type AnnotationSchemaReferences ¶
AnnotationSchemaReferences represents the reference collection.
func NewAnnotationSchemaOwnerReferences ¶
func NewAnnotationSchemaOwnerReferences(refs ...string) AnnotationSchemaReferences
func (AnnotationSchemaReferences) MarshalJSON ¶
func (s AnnotationSchemaReferences) MarshalJSON() ([]byte, error)
func (*AnnotationSchemaReferences) UnmarshalJSON ¶
func (s *AnnotationSchemaReferences) UnmarshalJSON(bytes []byte) error