securestore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 4 Imported by: ? modules, 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 securestore keeps small secrets (tokens, keys, passwords) in the platform's protected storage: the Keychain on iOS and macOS (generic passwords of the app, this device only, available after first unlock); on Android values encrypted with an AES key held in the Android Keystore, stored in the app's private SharedPreferences; the Credential Manager on Windows (generic credentials of the user, not roaming); and the Secret Service on Linux (GNOME Keyring, KWallet) through libsecret. Linux returns ErrUnsupported when libsecret-1 is not installed or no Secret Service is running (headless sessions).

securestore.SetString(a, "session", tok)
tok, err := securestore.GetString(a, "session") // ErrNotFound if never set

Items survive app updates; on iOS Keychain items may survive uninstalling the app. Values are meant to be small (kilobytes). Calls are safe from any goroutine and do not need the main thread. They return ErrUnsupported where the backend has no secure store.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupported = platform.ErrUnsupported
	ErrNotFound    = platform.ErrNotFound
)

Functions

func Delete

func Delete(a *tango.App, key string) error

Delete removes key; deleting a missing key is not an error.

func Get

func Get(a *tango.App, key string) ([]byte, error)

Get returns the value stored under key, or ErrNotFound.

func GetString

func GetString(a *tango.App, key string) (string, error)

GetString is Get for text.

func Set

func Set(a *tango.App, key string, value []byte) error

Set stores value under key, replacing any previous value.

func SetString

func SetString(a *tango.App, key, value string) error

SetString is Set for text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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