v1

package
v0.73.4-preview.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenDoesNotExist = errors.New("the token does not exist")
	ErrWrongPassphrase   = errors.New("wrong passphrase")
)
View Source
var ErrSavingTokenIsDisabled = errors.New("saving tokens is disabled")
View Source
var ErrStoreNotInitialized = errors.New("the tokens store has not been initialized")

Functions

func IsStoreBootstrapped

func IsStoreBootstrapped(p paths.Paths) (bool, error)

Types

type EmptyStore

type EmptyStore struct{}

EmptyStore can be used to disable the support for long-living API tokens.

func NewEmptyStore

func NewEmptyStore() *EmptyStore

func (EmptyStore) Close

func (e EmptyStore) Close()

func (EmptyStore) DeleteToken

func (e EmptyStore) DeleteToken(_ connections.Token) error

func (EmptyStore) DescribeToken

func (EmptyStore) ListTokens

func (e EmptyStore) ListTokens() ([]connections.TokenSummary, error)

func (EmptyStore) OnUpdate

func (e EmptyStore) OnUpdate(_ func(context.Context, ...connections.TokenDescription))

func (EmptyStore) SaveToken

func (EmptyStore) TokenExists

func (e EmptyStore) TokenExists(_ connections.Token) (bool, error)

type FileStore

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

func InitialiseStore

func InitialiseStore(p paths.Paths, passphrase string) (*FileStore, error)

func ReinitialiseStore

func ReinitialiseStore(p paths.Paths, passphrase string) (*FileStore, error)

func (*FileStore) Close

func (s *FileStore) Close()

func (*FileStore) DeleteToken

func (s *FileStore) DeleteToken(token connections.Token) error

func (*FileStore) DescribeToken

func (s *FileStore) DescribeToken(token connections.Token) (connections.TokenDescription, error)

func (*FileStore) ListTokens

func (s *FileStore) ListTokens() ([]connections.TokenSummary, error)

func (*FileStore) OnUpdate

func (s *FileStore) OnUpdate(callbackFn func(ctx context.Context, tokens ...connections.TokenDescription))

func (*FileStore) SaveToken

func (s *FileStore) SaveToken(token connections.TokenDescription) error

func (*FileStore) TokenExists

func (s *FileStore) TokenExists(token connections.Token) (bool, error)

Jump to

Keyboard shortcuts

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