auth

package
v0.0.0-...-b7a57f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrAlreadyExists = errors.New("already exists")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	// Name is the name of the context.
	Name string

	// Token identifies the user.
	Token string

	// Current is set to true if this should be the currently active context.
	Current bool
}

type Store

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

func New

func New(dir string) *Store

New creates a filestore. The caller is responsible to pass an existing directory.

func (*Store) Context

func (s *Store) Context(name string) (ctx Context, err error)

func (*Store) Contexts

func (s *Store) Contexts() (names []Context, err error)

func (*Store) CreateContext

func (s *Store) CreateContext(name, token string) (err error)

func (*Store) CurrentContext

func (s *Store) CurrentContext() (c Context, err error)

func (*Store) DeleteContext

func (s *Store) DeleteContext(name string) (err error)

func (*Store) SetCurrentContext

func (s *Store) SetCurrentContext(name string) (err error)

func (*Store) UpdateContext

func (s *Store) UpdateContext(name, token string) (err error)

type YamlAuthContext

type YamlAuthContext struct {
	Name    string `yaml:"name"`
	Token   string `yaml:"token"`
	Current bool   `yaml:"current"`
}

Jump to

Keyboard shortcuts

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