keyring

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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

This section is empty.

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