secrets

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeychainStore

type KeychainStore struct{}

KeychainStore uses the OS keychain via go-keyring. On macOS: system Keychain (not iCloud — go-keyring never sets kSecAttrSynchronizable). On Linux: libsecret / GNOME Keyring / KeePassXC via D-Bus. On Windows: Windows Credential Manager.

func (*KeychainStore) Available

func (k *KeychainStore) Available() bool

func (*KeychainStore) Delete

func (k *KeychainStore) Delete(ref string) error

func (*KeychainStore) Get

func (k *KeychainStore) Get(ref string) (string, error)

func (*KeychainStore) Set

func (k *KeychainStore) Set(ref, token string) error

type Store

type Store interface {
	Set(ref, token string) error
	Get(ref string) (string, error)
	Delete(ref string) error
	Available() bool
}

Store is the interface for token storage backends.

func Default

func Default() Store

Default returns the best available Store for the current machine. Prefers the OS keychain; falls back to nothing if unavailable. Callers can force a specific backend via GITSWITCH_SECRETS_BACKEND env var.

Jump to

Keyboard shortcuts

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