keys

package
v0.0.0-...-1ddd578 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueID = "unique_identifier"
	TokenKey = "active-token"

	// reserved: will be used encrypting user private keys
	// TODO: implement this ^
	ServerID = "secr-server-id"
)

Variables

This section is empty.

Functions

func UserBucket

func UserBucket(id uint64) string

UserBucket formats the input user ID as a user bucket identifier (`uid:###`)

Types

type Repository

type Repository interface {
	// Set creates or overwrites a secret identified by `k` with value `v`, in
	// bucket `bucket`. Returns an error
	Set(ctx context.Context, bucket, k string, v []byte) error
	// Get fetches the secret identified by `k` in the bucket `bucket`,
	// returning a slice of bytes for the value and an error
	Get(ctx context.Context, bucket, k string) ([]byte, error)
	// Delete removes the secret identified by `k` in bucket `bucket`, returning an error
	Delete(ctx context.Context, bucket, k string) error
	// Purge removes all the secrets in the bucket `bucket`, returning an error
	Purge(ctx context.Context, bucket string) error
}

Repository describes the action exposed by the keys store

func WithTrace

func WithTrace(r Repository) Repository

Jump to

Keyboard shortcuts

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