ezblob

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelKeyManagedBy = "app.kubernetes.io/managed-by"
	LabelValManagedBy = "ezblob.yankeguo.github.io"
	LabelKeyComponent = "app.kubernetes.io/component"
	LabelValComponent = "chunk"
	LabelKeyName      = "yankeguo.github.io/ezblob-name"
	LabelKeyRevision  = "yankeguo.github.io/ezblob-revision"

	KeyName     = "name"
	KeyRevision = "revision"
	KeyChunks   = "chunks"
	KeyChecksum = "checksum"

	KeyData = "data"
)
View Source
const (
	DefaultChunkSize = 4096
)

Variables

View Source
var (
	ErrNotFound         = errors.New("not found")
	ErrChecksumMismatch = errors.New("checksum mismatch")

	ErrInvalidHeaderFieldName     = errors.New("missing or invalid field in header secret: 'name'")
	ErrInvalidHeaderFieldChecksum = errors.New("missing or invalid field in header secret: 'checksum'")
	ErrInvalidHeaderFieldRevision = errors.New("missing or invalid field in header secret: 'revision'")
	ErrInvalidHeaderFieldChunks   = errors.New("missing or invalid field in header secret: 'chunks'")
)

Functions

This section is empty.

Types

type Blob

type Blob struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) (blob *Blob, err error)

New create a Blob

func (*Blob) Delete

func (b *Blob) Delete(ctx context.Context) (err error)

func (*Blob) Load

func (b *Blob) Load(ctx context.Context) (buf []byte, err error)

Load load all data from kubernetes secrets

func (*Blob) Save

func (b *Blob) Save(ctx context.Context, buf []byte) (err error)

Save save data to kubernetes secrets

type Options

type Options struct {
	// Client kubernetes client
	Client *kubernetes.Clientset
	// Name Blob name, also used as Secret name
	Name string
	// Namespace kubernetes namespace
	Namespace string
	// ChunkSize maximum size of each chunk
	ChunkSize int
}

Options Blob options

Jump to

Keyboard shortcuts

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