users

package
v0.0.0-...-e7bb422 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugin = plugins.Plugin{
	Inject: NewUsers,
}

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(count int) *Cache

func (*Cache) Delete

func (v *Cache) Delete(login string)

func (*Cache) FlushAll

func (v *Cache) FlushAll()

func (*Cache) Get

func (v *Cache) Get(login string) (User, bool)

func (*Cache) Set

func (v *Cache) Set(u User)

type User

type User struct {
	ID       int64
	Login    string
	Passwd   []byte
	TempKey  []byte
	TempHash []byte
	Groups   map[int64]struct{}
}

type Users

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

func NewUsers

func NewUsers(db db.DB) *Users

func (*Users) AppendUserToGroups

func (v *Users) AppendUserToGroups(ctx context.Context, login string, groups ...int64) error

func (*Users) CreateGroup

func (v *Users) CreateGroup(ctx context.Context, name string) error

func (*Users) CreateUser

func (v *Users) CreateUser(ctx context.Context, login, passwd string) error

func (*Users) DeleteUserFromGroups

func (v *Users) DeleteUserFromGroups(ctx context.Context, login string, groups ...int64) error

func (*Users) Down

func (v *Users) Down() error

func (*Users) Get

func (v *Users) Get(ctx context.Context, login string) (User, error)

func (*Users) HasUserInGroup

func (v *Users) HasUserInGroup(ctx context.Context, login string, groups ...int64) bool

func (*Users) ListGroup

func (v *Users) ListGroup(ctx context.Context) (map[int64]string, error)

func (*Users) Up

func (v *Users) Up(ctx app.Context) error

func (*Users) ValidateUserPasswd

func (v *Users) ValidateUserPasswd(ctx context.Context, login, passwd string) bool

Jump to

Keyboard shortcuts

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