Documentation
¶
Overview ¶
Package keyring is a thin wrapper around github.com/zalando/go-keyring that adds timeouts (matching the pattern used by the official GitHub CLI) and provides mock helpers for testing.
This package exists so Sting can follow gh's exact storage standards and testability approach without pulling in the entire gh codebase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("secret not found in keyring")
Functions ¶
func Get ¶
Get retrieves a secret from the keyring. It times out after 3 seconds. Returns ErrNotFound (wrapping the underlying not-found error) when the secret does not exist.
func MockInit ¶
func MockInit()
MockInit initializes the underlying keyring with an in-memory mock. Use this in tests.
func MockInitWithError ¶
func MockInitWithError(err error)
MockInitWithError initializes the underlying keyring mock to always return the given error. Useful for testing error paths.
Types ¶
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string