secret

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyID          = "id"
	KeyNamespace   = "namespace"
	KeyName        = "name"
	KeyAnnotations = "annotations"
	KeyData        = "data"
)

Key constants for commonly used fields.

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret struct {
	// ID is the unique identifier of the secret.
	ID uuid.UUID `json:"id" bson:"_id" yaml:"id" map:"id" validate:"required"`
	// Namespace groups secrets logically.
	Namespace string `json:"namespace" bson:"namespace" yaml:"namespace" map:"namespace" validate:"required"`
	// Name is the human-readable name of the secret.
	Name string `json:"name,omitempty" bson:"name,omitempty" yaml:"name,omitempty" map:"name,omitempty"`
	// Annotations hold additional metadata.
	Annotations map[string]string `json:"annotations,omitempty" bson:"annotations,omitempty" yaml:"annotations,omitempty" map:"annotations,omitempty"`
	// Data holds the secret's actual data.
	Data any `json:"data" bson:"data" yaml:"data" map:"data" validate:"required"`
}

Secret defines the interface for a secret with various attributes.

func New added in v0.11.0

func New() *Secret

New creates and returns a new instance of Secret.

func (*Secret) GetAnnotations

func (s *Secret) GetAnnotations() map[string]string

GetAnnotations returns the secret's annotations.

func (*Secret) GetData

func (s *Secret) GetData() any

GetData returns the secret's data.

func (*Secret) GetID

func (s *Secret) GetID() uuid.UUID

GetID returns the secret's unique identifier.

func (*Secret) GetName

func (s *Secret) GetName() string

GetName returns the secret's name.

func (*Secret) GetNamespace

func (s *Secret) GetNamespace() string

GetNamespace returns the secret's namespace.

func (*Secret) IsIdentified added in v0.11.0

func (s *Secret) IsIdentified() bool

IsIdentified checks whether the Value instance has a unique identifier or name.

func (*Secret) SetAnnotations

func (s *Secret) SetAnnotations(val map[string]string)

SetAnnotations sets the secret's annotations.

func (*Secret) SetData

func (s *Secret) SetData(val any)

SetData sets the secret's data.

func (*Secret) SetID

func (s *Secret) SetID(val uuid.UUID)

SetID assigns a unique identifier to the secret.

func (*Secret) SetName

func (s *Secret) SetName(val string)

SetName sets the secret's name.

func (*Secret) SetNamespace

func (s *Secret) SetNamespace(val string)

SetNamespace sets the secret's namespace.

type Store

type Store resource.Store[*Secret]

Store is an alias for the resource.Store interface, specifically for *Secret resources.

func NewStore

func NewStore() Store

NewStore creates and returns a new instance of a Store for managing *Secret resources.

type Stream

type Stream = resource.Stream

Jump to

Keyboard shortcuts

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