Documentation ¶
Index ¶
- Constants
- Variables
- type BoltStore
- func (bs *BoltStore) AddAudit(host, user, action string) error
- func (bs *BoltStore) Admin(user string) (admin bool)
- func (bs *BoltStore) Audit(date string) (a []core.Audit, err error)
- func (bs *BoltStore) Client(host string) (c core.Client, err error)
- func (bs *BoltStore) ClientConns() (all int, conn int)
- func (bs *BoltStore) ClientExists(host string) (exists bool)
- func (bs *BoltStore) ClientGroups(host string) (gr []core.Group, err error)
- func (bs *BoltStore) Clients() (cl []core.Client, err error)
- func (bs *BoltStore) Close() error
- func (bs *BoltStore) CreateClient(c *core.Client) (err error)
- func (bs *BoltStore) CreateGroup(g *core.Group) error
- func (bs *BoltStore) CreateUser(u *core.User) error
- func (bs *BoltStore) DeleteClient(host string) (err error)
- func (bs *BoltStore) DeleteGroup(name string) error
- func (bs *BoltStore) DeleteUser(user string) (err error)
- func (bs *BoltStore) Group(name string) (g core.Group, err error)
- func (bs *BoltStore) GroupClients(name string) (cl []core.Client, err error)
- func (bs *BoltStore) GroupExists(name string) (exists bool)
- func (bs *BoltStore) GroupMember(name, user string) (member bool)
- func (bs *BoltStore) GroupMemberClients(name string) (cm map[string]bool, err error)
- func (bs *BoltStore) GroupMemberUsers(name string) (um map[string]bool, err error)
- func (bs *BoltStore) Groups() (gr []core.Group, err error)
- func (bs *BoltStore) Init() error
- func (bs *BoltStore) Login(user, password string) error
- func (bs *BoltStore) NoPWUser(user string) (u core.User, err error)
- func (bs *BoltStore) ResetClients() error
- func (bs *BoltStore) ReverseAudit(date string) (a []core.Audit, err error)
- func (bs *BoltStore) SetComment(host, comment string) error
- func (bs *BoltStore) Stats() bolt.Stats
- func (bs *BoltStore) Type() string
- func (bs *BoltStore) Unlock(user string) error
- func (bs *BoltStore) UpdateClient(c *core.Client, setinfo, conn bool) error
- func (bs *BoltStore) UpdateClientPackages(host string, pa []core.Package) error
- func (bs *BoltStore) UpdateGroup(g *core.Group) error
- func (bs *BoltStore) UpdateLastLogin(user string) error
- func (bs *BoltStore) UpdatePassword(u *core.User) error
- func (bs *BoltStore) UpdateUser(u *core.User) error
- func (bs *BoltStore) User(user string) (u core.User, err error)
- func (bs *BoltStore) UserClient(user, host string) (bool, error)
- func (bs *BoltStore) UserClients(user string) (uc map[string]bool, err error)
- func (bs *BoltStore) UserExists(user string) (exists bool)
- func (bs *BoltStore) UserGroups(user string) (gr []core.Group, err error)
- func (bs *BoltStore) Users() (us []core.User, err error)
Constants ¶
const ( // LocalAuthType represents the local auth LocalAuthType = "local" // AdminUser is the default admin user AdminUser = "admin" )
const DefaultGroup = "default"
DefaultGroup is the default group
Variables ¶
var ( // ErrNotFound key not found error ErrNotFound = errors.New("db: key not found") // ErrExists key exists error ErrExists = errors.New("db: key already exists") )
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
BoltStore database store
var DB *BoltStore
DB is the globally shared database object
func NewBoltStore ¶
NewBoltStore returns a new BoltStore of the given file
func (*BoltStore) ClientConns ¶
ClientConns returns the number of all clients and all connected clients
func (*BoltStore) ClientExists ¶
ClientExists checks if the given client already exists
func (*BoltStore) ClientGroups ¶
ClientGroups returns all groups of the given client
func (*BoltStore) CreateClient ¶
CreateClient creates a new client
func (*BoltStore) CreateGroup ¶
CreateGroup creates a new group
func (*BoltStore) CreateUser ¶
CreateUser creates a new user
func (*BoltStore) DeleteClient ¶
DeleteClient deletes the given client
func (*BoltStore) DeleteGroup ¶
DeleteGroup deletes the given group
func (*BoltStore) DeleteUser ¶
DeleteUser deletes the given user and removes it from all associated groups
func (*BoltStore) GroupClients ¶
GroupClients returns all clients of the given group
func (*BoltStore) GroupExists ¶
GroupExists checks if the given group already exists
func (*BoltStore) GroupMember ¶
GroupMember checks if the given user is a member of the given group
func (*BoltStore) GroupMemberClients ¶
GroupMemberClients returns all clients and if they are a member of the given group
func (*BoltStore) GroupMemberUsers ¶
GroupMemberUsers returns all users and if they are a member of the given group
func (*BoltStore) ResetClients ¶
ResetClients resets some basic client stats
func (*BoltStore) ReverseAudit ¶
ReverseAudit returns the audit entrys of the given date in reverse order
func (*BoltStore) SetComment ¶
SetComment changes the comment for the given client
func (*BoltStore) UpdateClient ¶
UpdateClient updates client information
func (*BoltStore) UpdateClientPackages ¶
UpdateClientPackages updates the given clients package list
func (*BoltStore) UpdateGroup ¶
UpdateGroup updates group information
func (*BoltStore) UpdateLastLogin ¶
UpdateLastLogin updates the users LastLogin field
func (*BoltStore) UpdatePassword ¶
UpdatePassword updates the users password hash
func (*BoltStore) UpdateUser ¶
UpdateUser updates the given user information
func (*BoltStore) UserClient ¶
UserClient checks if the given client is associated with the given user
func (*BoltStore) UserClients ¶
UserClients returns all clients associated with the given user
func (*BoltStore) UserExists ¶
UserExists checks if the given user exists
func (*BoltStore) UserGroups ¶
UserGroups returns all groups of the given user