store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpired = errors.New("secret expired or consumed")
View Source
var ErrNotFound = errors.New("secret not found")
View Source
var ErrUnauthorized = errors.New("unauthorized: invalid delete token")

Functions

This section is empty.

Types

type SecretMeta

type SecretMeta struct {
	ID        string
	ViewsLeft int
	ExpiresAt time.Time
	CreatedAt time.Time
}

SecretMeta is the return type for List(), used by the MCP list_secrets tool.

type Store

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

func New

func New(dbPath string) (*Store, error)

func (*Store) Cleanup

func (s *Store) Cleanup() (int, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) Create

func (s *Store) Create(id string, encrypted, iv []byte, viewsLeft int, expiresAt time.Time, deleteToken string) error

Create stores a new secret.

func (*Store) Delete

func (s *Store) Delete(id string, deleteToken string) error

func (*Store) Get

func (s *Store) Get(id string) (encrypted, iv []byte, err error)

func (*Store) List

func (s *Store) List() ([]SecretMeta, error)

func (*Store) Ping

func (s *Store) Ping() error

func (*Store) Status

func (s *Store) Status(id string) error

Jump to

Keyboard shortcuts

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