keyring

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package keyring stores Melange credentials in the OS keychain via zalando/go-keyring. Entries live under the "melange-cli" service, keyed by host (scheme stripped, port kept — see HostKey).

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no credentials found in keyring")

ErrNotFound is returned when no credential is stored for a host.

Functions

func Delete

func Delete(host string) error

Delete removes the token stored for host, or returns ErrNotFound.

func Get

func Get(host string) (string, error)

Get returns the token stored for host, or ErrNotFound.

func HostKey

func HostKey(host string) string

HostKey normalizes a host or URL into the keyring key: scheme and path are stripped, the port is kept ("https://api.zetic.ai:8443/v1" -> "api.zetic.ai:8443").

func Lookup

func Lookup(host string) (string, bool, error)

Lookup adapts Get to the config token-resolution lookup signature.

func Set

func Set(host, token string) error

Set stores the token for host.

Types

This section is empty.

Jump to

Keyboard shortcuts

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