config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	GetConfig(name string) ([]byte, error)
	PutConfig(name string, content []byte, user, message string) error
}

type DummyStore

type DummyStore struct{}

func (DummyStore) GetSettings

func (d DummyStore) GetSettings(name string, _ interface{}) error

func (DummyStore) PutSettings

func (d DummyStore) PutSettings(string, string, string, interface{}) error

type EncryptedStore

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

func (EncryptedStore) GetSettings

func (c EncryptedStore) GetSettings(name string, val interface{}) error

func (EncryptedStore) PutSettings

func (c EncryptedStore) PutSettings(name, user, message string, val interface{}) error

type Secrets

type Secrets struct {
	SessionKey []byte
	CsrfKey    []byte
}

func LoadSecrets

func LoadSecrets(store Store) (*Secrets, error)

type Store

type Store interface {
	GetSettings(name string, val interface{}) error
	PutSettings(name, user, message string, val interface{}) error
}

func NewStore

func NewStore(backend Backend, key string) Store

type User

type User struct {
	Name     string
	Salt     []byte
	Password []byte
}

type UserManager

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

func NewUserManager

func NewUserManager(store Store) (*UserManager, error)

func (*UserManager) AddUser

func (a *UserManager) AddUser(user, password, responsible string) error

func (*UserManager) Authenticate

func (a *UserManager) Authenticate(username, password string) (*User, error)

func (*UserManager) Delete

func (a *UserManager) Delete(user, responsible string) error

func (*UserManager) Empty

func (a *UserManager) Empty() bool

func (*UserManager) SetPassword

func (a *UserManager) SetPassword(user, password, responsible string) error

func (*UserManager) User

func (a *UserManager) User(username string) *User

func (*UserManager) Users

func (a *UserManager) Users() []*User

type UserSettings

type UserSettings struct {
	Users []*User
}

Jump to

Keyboard shortcuts

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