crud

package
Version: v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretLabelKey = "storage.pinniped.dev/type"

	SecretLifetimeAnnotationKey        = "storage.pinniped.dev/garbage-collect-after"
	SecretLifetimeAnnotationDateFormat = time.RFC3339

	ErrSecretTypeMismatch    = constable.Error("secret storage data has incorrect type")
	ErrSecretLabelMismatch   = constable.Error("secret storage data has incorrect label")
	ErrSecretVersionMismatch = constable.Error("secret storage data has incorrect version")
)

Variables

This section is empty.

Functions

func FromSecret added in v0.13.0

func FromSecret(resource string, secret *corev1.Secret, data JSON) error

FromSecret is similar to Get, but for when you already have a Secret in hand, e.g. from an informer. It validates and unmarshals the Secret. The data parameter is filled in as the result.

Types

type JSON

type JSON interface{} // document that we need valid JSON types

type Storage

type Storage interface {
	Create(ctx context.Context, signature string, data JSON, additionalLabels map[string]string) (resourceVersion string, err error)
	Get(ctx context.Context, signature string, data JSON) (resourceVersion string, err error)
	Update(ctx context.Context, signature, resourceVersion string, data JSON) (newResourceVersion string, err error)
	Delete(ctx context.Context, signature string) error
	DeleteByLabel(ctx context.Context, labelName string, labelValue string) error
}

func New

func New(resource string, secrets corev1client.SecretInterface, clock func() time.Time, lifetime time.Duration) Storage

Source Files

Jump to

Keyboard shortcuts

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