secrets

package
v0.0.0-...-53c0ad9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages OAuth tokens in the system keyring.

func OpenDefault

func OpenDefault() (*Store, error)

OpenDefault opens the default keyring store.

func (*Store) DeleteToken

func (s *Store) DeleteToken(email string) error

DeleteToken removes the token for the given email.

func (*Store) GetToken

func (s *Store) GetToken(email string) (Token, error)

GetToken retrieves the token for the given email.

func (*Store) ListTokens

func (s *Store) ListTokens() ([]Token, error)

ListTokens returns all stored tokens.

func (*Store) SetToken

func (s *Store) SetToken(email string, tok Token) error

SetToken stores a token for the given email.

type Token

type Token struct {
	Email        string    `json:"email"`
	Services     []string  `json:"services,omitempty"`
	Scopes       []string  `json:"scopes,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	RefreshToken string    `json:"-"`
}

Token is stored in the keyring for each account.

Jump to

Keyboard shortcuts

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