Documentation
¶
Overview ¶
Package bbolt handles transaction with the deprecated bbolt database
Index ¶
- func DBFilename() string
- func RemoveDb(dbDir string) error
- func Z_ForTests_CreateDBFromYAML(src, destDir string) (err error)
- type Database
- func (c *Database) AllGroups() (all []GroupDB, err error)
- func (c *Database) AllUsers() (all []UserDB, err error)
- func (c *Database) BrokerForUser(username string) (brokerID string, err error)
- func (c *Database) Close() error
- func (c *Database) DeleteUser(uid uint32) error
- func (c *Database) GroupByID(gid uint32) (GroupDB, error)
- func (c *Database) GroupByName(name string) (GroupDB, error)
- func (c *Database) GroupByUGID(ugid string) (GroupDB, error)
- func (c *Database) UpdateBrokerForUser(username, brokerID string) error
- func (c *Database) UpdateUserEntry(user UserDB, authdGroups []GroupDB, localGroups []string) error
- func (c *Database) UserByID(uid uint32) (UserDB, error)
- func (c *Database) UserByName(name string) (UserDB, error)
- func (c *Database) UserGroups(uid uint32) ([]GroupDB, error)
- func (c *Database) UserLocalGroups(uid uint32) ([]string, error)
- type GroupDB
- type NoDataFoundError
- type UserDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Z_ForTests_CreateDBFromYAML ¶
Z_ForTests_CreateDBFromYAML creates the database inside destDir and loads the src file content into it.
nolint:revive,nolintlint // We want to use underscores in the function name here.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is our database API.
func (*Database) BrokerForUser ¶
BrokerForUser returns the broker ID assigned to the given username, empty if it's not assigned yet or an error if no user was found in the database.
func (*Database) DeleteUser ¶
DeleteUser removes the user from the database.
func (*Database) GroupByID ¶
GroupByID returns a group matching this gid or an error if the database is corrupted or no entry was found.
func (*Database) GroupByName ¶
GroupByName returns a group matching a given name or an error if the database is corrupted or no entry was found.
func (*Database) GroupByUGID ¶
GroupByUGID returns a group matching this ugid or an error if the database is corrupted or no entry was found.
func (*Database) UpdateBrokerForUser ¶
UpdateBrokerForUser updates the last broker the user successfully authenticated with.
func (*Database) UpdateUserEntry ¶
UpdateUserEntry inserts or updates user and group buckets from the user information.
func (*Database) UserByID ¶
UserByID returns a user matching this uid or an error if the database is corrupted or no entry was found.
func (*Database) UserByName ¶
UserByName returns a user matching this name or an error if the database is corrupted or no entry was found.
func (*Database) UserGroups ¶
UserGroups returns all groups for a given user or an error if the database is corrupted or no entry was found.
type NoDataFoundError ¶
type NoDataFoundError struct {
// contains filtered or unexported fields
}
NoDataFoundError is returned when we didn’t find a matching entry.
func (NoDataFoundError) Error ¶
func (err NoDataFoundError) Error() string
Error implements the error interface to return key/bucket name.
func (NoDataFoundError) Is ¶
func (NoDataFoundError) Is(target error) bool
Is makes this error insensitive to the key and bucket name.
type UserDB ¶
type UserDB struct {
Name string
UID uint32
GID uint32
Gecos string // Gecos is an optional field. It can be empty.
Dir string
Shell string
// Shadow entries
LastPwdChange int
MaxPwdAge int
PwdWarnPeriod int
PwdInactivity int
MinPwdAge int
ExpirationDate int
}
UserDB is the public type that is shared to external packages.