kms

package
v0.5.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Get retrieves a data for the given key(i.e. /dir/key) from the Driver,
	// returns an error if no such key.
	Get(ctx context.Context, key string) ([]byte, error)

	// Put stores the data in the Driver under the given key(i.e. /dir/key),
	// returns error if the operation was not successful,
	// otherwise, Get, must results in the original data.
	Put(ctx context.Context, key string, value []byte) error

	// Delete removes a data from the Driver under the given key(i.e. /dir/key),
	// returns nil if no such key.
	Delete(ctx context.Context, key string) error

	// List lists all data under the path(i.e. /dir).
	List(ctx context.Context, path string) ([]KeyValue, error)
}

type KeyValue

type KeyValue struct {
	Path      string `json:"path"`
	Key       string `json:"key"`
	ValueHash string `json:"valueHash"`
	ValueSize string `json:"valueSize"`
}

type KubernetesDriver

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

func NewKubernetes

func NewKubernetes(ctx context.Context, opts KubernetesOptions) (*KubernetesDriver, error)

func (KubernetesDriver) Delete

func (d KubernetesDriver) Delete(ctx context.Context, key string) error

func (KubernetesDriver) Get

func (d KubernetesDriver) Get(ctx context.Context, key string) ([]byte, error)

func (KubernetesDriver) List

func (d KubernetesDriver) List(_ context.Context, path string) ([]KeyValue, error)

func (KubernetesDriver) Put

func (d KubernetesDriver) Put(ctx context.Context, key string, v []byte) error

type KubernetesOptions

type KubernetesOptions struct {
	// Namespace indicates the working namespace.
	Namespace string
	// Config indicates the rest config.
	Config *rest.Config
	// Group indicates the groups to place the data,
	// the key must be unique under the one group,
	// but we can hold the same key under different groups.
	Group string
	// Logger indicates the logger used by the driver,
	// uses default logger if not set.
	Logger log.Logger
	// RaiseNotFound indicates the function to raise not found error,
	// uses default function if not set.
	RaiseNotFound func(key string) error
}

Jump to

Keyboard shortcuts

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