Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PwDB ¶
type PwDB struct {
// contains filtered or unexported fields
}
PwDB implements the Store interface to load and store data in an SQL database. Data is stored in a table called "user" with three string columns, id, cryptword, and permissions, where the permissions value is a comma-separated list of permission names.
func (*PwDB) CreatePasswordTable ¶
func (*PwDB) SetSaltword ¶
type PwFile ¶
type PwFile struct {
// contains filtered or unexported fields
}
PwFile implements the Store interface to load and store data in a file similar to a Unix /etc/passwd file. Each line has data for one user in colon-separated fields with the format
username:password:permissions
where the permissions field is a comma-separated list of permission names.
func (*PwFile) CreatePasswordFile ¶
func (*PwFile) SetSaltword ¶
type Store ¶
type Store interface { Load() error // Load our data before other operations Save() error // Save our data after other operations User(username string) *users.User // Retrieve a user record by id SetSaltword(username, saltword string) // Set the saltword for a user UserCount() int // Get the number of users in our records }
The Store interface is used by our classes that need to load and save the user/password/premissions data.
Click to show internal directories.
Click to hide internal directories.