Documentation ¶
Overview ¶
Package datastore provides the DataStore interface and entity types
Index ¶
Constants ¶
const ( Invalid = iota // 0 Standard = 100 * iota // 100 Admin // 200 Superuser // 300 )
Available user roles:
* Invalid: default value set in case there is no authentication previous process for this user and thus not got a valid role. * Standard: role for regular users. This is the less privileged role * Admin: role for createsuperuser users, including standard role permissions but not superuser ones * Superuser: role for users having all the permissions
const MaxNonceAgeInSeconds = 60
MaxNonceAgeInSeconds is the nonce age
const OpenidNonceMaxAge = MaxNonceAgeInSeconds * time.Second
OpenidNonceMaxAge is the maximum age of stored nonces. Any nonces older than this will automatically be rejected. Stored nonces older than this will periodically be purged from the database.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
type DataStore interface { OpenIDNonceStore() openid.NonceStore CreateUser(user User) (int64, error) GetUser(username string) (User, error) UserList() ([]User, error) UserUpdate(user User) error UserDelete(username string) error OrgUserAccess(orgID, username string, role int) bool OrganizationsForUser(username string) ([]Organization, error) OrganizationForUserToggle(orgID, username string) error OrganizationGet(orgID string) (Organization, error) OrganizationCreate(org Organization) error OrganizationUpdate(org Organization) error GetSettings() ([]models.Setting, error) Set(key string, value string) error }
DataStore is the interfaces for the data repository
type OpenidNonce ¶
OpenidNonce holds the details of the nonce, combining a timestamp and random text
type Organization ¶
Organization holds details of the organization
type OrganizationUser ¶
OrganizationUser holds links a user and organization
Directories ¶
Path | Synopsis |
---|---|
Package memory is an in-memory implementation of the DataStore
|
Package memory is an in-memory implementation of the DataStore |
Package models provides the models for database types with GORM
|
Package models provides the models for database types with GORM |
Package postgres provides the postgres based DataStore implementation
|
Package postgres provides the postgres based DataStore implementation |