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) 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) 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.