vault

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrItemAlreadyExist = errors.New("item already exist")
	ErrKeyNotFound      = errors.New("key not found")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*va.Client
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, addr, token, engine, description string) (*Client, error)

type Vault

type Vault[T any] interface {
	Add(ctx context.Context, name string, model T) error
	Get(ctx context.Context, name string) (*T, error)
	List(ctx context.Context) (map[string]T, error)
	Remove(ctx context.Context, name string) error
	Update(ctx context.Context, name string, model T) error
	Ping(ctx context.Context) error
}

func NewRepository

func NewRepository[T any](client *Client, key string) Vault[T]

Jump to

Keyboard shortcuts

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