users

package
v0.0.0-...-16263d8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

func NewUser

func NewUser(username, saltword string, perms *permissions.Permissions) *User

func (*User) HasPermission

func (u *User) HasPermission(perm permissions.Permission) bool

func (*User) Id

func (u *User) Id() string

func (*User) Permissions

func (u *User) Permissions() *permissions.Permissions

func (*User) PermissionsString

func (u *User) PermissionsString() string

func (*User) Saltword

func (u *User) Saltword() string

func (*User) SetSaltword

func (u *User) SetSaltword(saltword string)

type Users

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

func Empty

func Empty() *Users

func NewUsers

func NewUsers(users map[string]*User) *Users

func (*Users) AddUser

func (m *Users) AddUser(username, saltword string, perms *permissions.Permissions)

func (*Users) HasPermission

func (m *Users) HasPermission(username string, perm permissions.Permission) bool

func (*Users) Saltword

func (m *Users) Saltword(username string) string

func (*Users) SetSaltword

func (m *Users) SetSaltword(username, saltword string)

func (*Users) ToArray

func (m *Users) ToArray() []*User

ToArray returns an array of *User sorted by username.

func (*Users) User

func (m *Users) User(username string) *User

func (*Users) UserCount

func (m *Users) UserCount() int

Jump to

Keyboard shortcuts

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