Справочник API собран из Go doc-комментариев в исходном коде и написан на английском языке.
package keychain
import "github.com/nsgo-dev/game/pkg/editor/keychain"Обзор
Package keychain stores secrets in the host OS keychain: macOS Keychain, the Freedesktop Secret Service on Linux, and Windows Credential Manager, with an in-memory Store for tests. It imports only the standard library.
Указатель
Переменные
var ErrNotFound = errors.New("keychain: credential not found in system keychain")ErrNotFound is returned by Store.Get when no secret is stored for the requested service and account.
ErrUnavailable is returned when the host platform does not expose a desktop system keychain.
Типы
type Memory struct {
// contains filtered or unexported fields
}Memory is a thread-safe in-memory Store implementation for tests and sandboxed tooling.
func (m *Memory) Delete(service, account string) errorDelete removes any secret stored under (service, account) in memory.
func (m *Memory) Get(service, account string) (string, error)Get retrieves the secret stored under (service, account) in memory.
func (m *Memory) Len() intLen returns the number of entries currently stored in memory.
func (m *Memory) Set(service, account, secret string) errorSet stores secret under (service, account) in memory.
type Store interface {
Set(service, account, secret string) error
Get(service, account string) (string, error)
Delete(service, account string) error
}Store stores, retrieves, and removes secrets in the host OS keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager) or an in-memory test store. Secrets must never be written into project files.
func Default() StoreDefault returns the platform's native system keychain implementation.