accesstoken

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(backend Backend, provided string) (string, error)

func Set

func Set(backend Backend, token string) error

Types

type Backend

type Backend interface {
	Get() (string, error)
	Set(token string) error
}

type FileBackend

type FileBackend struct {
	Dir        string
	FileSystem fs.FileSystem
}

func NewFileBackend

func NewFileBackend(dir string, filesystem fs.FileSystem) (*FileBackend, error)

func (FileBackend) Get

func (f FileBackend) Get() (string, error)

func (FileBackend) Set

func (f FileBackend) Set(value string) error

type MemoryBackend

type MemoryBackend struct {
	Token string
}

func NewMemoryBackend

func NewMemoryBackend() (*MemoryBackend, error)

func (*MemoryBackend) Get

func (f *MemoryBackend) Get() (string, error)

func (*MemoryBackend) Set

func (f *MemoryBackend) Set(value string) error

Jump to

Keyboard shortcuts

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