secrets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSecret

func DeleteSecret(key string) error

DeleteSecret removes a secret by key. Returns nil if the key doesn't exist.

func GetSecret

func GetSecret(key string) ([]byte, error)

GetSecret retrieves a generic secret by key.

func HasSecret

func HasSecret(key string) (bool, error)

HasSecret checks if a secret exists in the keyring.

func SetSecret

func SetSecret(key string, value []byte) error

SetSecret stores a generic secret by key.

Types

type KeyringBackendInfo

type KeyringBackendInfo struct {
	Value  string
	Source string
}

func ResolveKeyringBackendInfo

func ResolveKeyringBackendInfo() (KeyringBackendInfo, error)

type KeyringStore

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

func (*KeyringStore) DeleteAPIKey

func (s *KeyringStore) DeleteAPIKey() error

func (*KeyringStore) GetAPIKey

func (s *KeyringStore) GetAPIKey() (string, error)

func (*KeyringStore) HasKey

func (s *KeyringStore) HasKey() (bool, error)

func (*KeyringStore) SetAPIKey

func (s *KeyringStore) SetAPIKey(key string) error

type Store

type Store interface {
	GetAPIKey() (string, error)
	SetAPIKey(key string) error
	DeleteAPIKey() error
	HasKey() (bool, error)
}

func OpenDefault

func OpenDefault() (Store, error)

Jump to

Keyboard shortcuts

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