api

package
v0.0.0-...-358ca0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSliceElement

func DeleteSliceElement[E comparable](s []E, elem E) []E

func GetAnnotationsAnnotation

func GetAnnotationsAnnotation(o Metadata, key string) (map[string]string, error)

func GetLabelsAnnotation

func GetLabelsAnnotation(o Metadata, key string) (map[string]string, error)

func SetAnnotationsAnnotation

func SetAnnotationsAnnotation(o Object, key string, annotations map[string]string) error

func SetLabelsAnnotation

func SetLabelsAnnotation(o Object, key string, labels map[string]string) error

func Zero

func Zero[E any]() E

Types

type Metadata

type Metadata struct {
	ID          string            `json:"id"`
	Annotations map[string]string `json:"annotations"`
	Labels      map[string]string `json:"labels"`

	CreatedAt       time.Time  `json:"createdAt"`
	DeletedAt       *time.Time `json:"deletedAt,omitempty"`
	Generation      int64      `json:"generation"`
	ResourceVersion uint64     `json:"resourceVersion"`

	Finalizers []string `json:"finalizers,omitempty"`
}

func (*Metadata) GetAnnotations

func (m *Metadata) GetAnnotations() map[string]string

func (*Metadata) GetCreatedAt

func (m *Metadata) GetCreatedAt() time.Time

func (*Metadata) GetDeletedAt

func (m *Metadata) GetDeletedAt() *time.Time

func (*Metadata) GetFinalizers

func (m *Metadata) GetFinalizers() []string

func (*Metadata) GetGeneration

func (m *Metadata) GetGeneration() int64

func (*Metadata) GetID

func (m *Metadata) GetID() string

func (*Metadata) GetLabels

func (m *Metadata) GetLabels() map[string]string

func (*Metadata) GetResourceVersion

func (m *Metadata) GetResourceVersion() uint64

func (*Metadata) IncrementResourceVersion

func (m *Metadata) IncrementResourceVersion()

func (*Metadata) SetAnnotations

func (m *Metadata) SetAnnotations(annotations map[string]string)

func (*Metadata) SetCreatedAt

func (m *Metadata) SetCreatedAt(createdAt time.Time)

func (*Metadata) SetDeletedAt

func (m *Metadata) SetDeletedAt(deleted *time.Time)

func (*Metadata) SetFinalizers

func (m *Metadata) SetFinalizers(finalizers []string)

func (*Metadata) SetGeneration

func (m *Metadata) SetGeneration(generation int64)

func (*Metadata) SetID

func (m *Metadata) SetID(id string)

func (*Metadata) SetLabels

func (m *Metadata) SetLabels(labels map[string]string)

type Object

type Object interface {
	GetID() string
	GetAnnotations() map[string]string
	GetLabels() map[string]string
	GetCreatedAt() time.Time
	GetDeletedAt() *time.Time
	GetGeneration() int64
	GetFinalizers() []string
	GetResourceVersion() uint64

	SetID(id string)
	SetAnnotations(annotations map[string]string)
	SetLabels(labels map[string]string)
	SetCreatedAt(createdAt time.Time)
	SetDeletedAt(deleted *time.Time)
	SetGeneration(generation int64)
	SetFinalizers(finalizers []string)
	IncrementResourceVersion()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL