keyring

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 9 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

Overview

Package keyring provides a composite keyring provider that supports multiple backends. It supports macOS Keychain, Windows Credential Manager, and Linux D-Bus Secret Service, with keyctl as a fallback on Linux systems.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("key not found")

ErrNotFound is returned when a requested key is not found in the keyring

Functions

func GenerateUniqueTestKey added in v0.4.0

func GenerateUniqueTestKey() string

GenerateUniqueTestKey creates a unique key name used for keyring availability checks. It combines a timestamp and random bytes to prevent naming collisions when multiple checks run concurrently.

Types

type Provider

type Provider interface {
	Set(service, key, value string) error

	Get(service, key string) (string, error)

	Delete(service, key string) error

	DeleteAll(service string) error

	IsAvailable() bool

	Name() string
}

Provider defines the interface for keyring backends

func NewCompositeProvider

func NewCompositeProvider() Provider

NewCompositeProvider creates a new composite keyring provider that combines multiple backends. It uses zalando/go-keyring as the primary provider and keyctl as a fallback on Linux.

func NewKeyctlProvider

func NewKeyctlProvider() (Provider, error)

NewKeyctlProvider creates a new keyring provider using Linux keyctl. It initializes access to the user keyring for persistence across process invocations.

func NewZalandoKeyringProvider

func NewZalandoKeyringProvider() Provider

NewZalandoKeyringProvider creates a new provider that wraps zalando/go-keyring. This provider supports macOS Keychain, Windows Credential Manager, and Linux D-Bus Secret Service.

Jump to

Keyboard shortcuts

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