Documentation ¶
Overview ¶
Package memory is an in-memory implementation of the DataStore
Index ¶
- type NonceStore
- type Store
- func (mem *Store) CreateUser(user datastore.User) (int64, error)
- func (mem *Store) GetSettings() ([]models.Setting, error)
- func (mem *Store) GetUser(username string) (datastore.User, error)
- func (mem *Store) OpenIDNonceStore() openid.NonceStore
- func (mem *Store) OrgUserAccess(orgID, username string, role int) bool
- func (mem *Store) OrganizationCreate(org datastore.Organization) error
- func (mem *Store) OrganizationForUserToggle(orgID, username string) error
- func (mem *Store) OrganizationGet(orgID string) (datastore.Organization, error)
- func (mem *Store) OrganizationUpdate(org datastore.Organization) error
- func (mem *Store) OrganizationsForUser(username string) ([]datastore.Organization, error)
- func (mem *Store) Set(key string, value string) error
- func (mem *Store) UserDelete(username string) error
- func (mem *Store) UserList() ([]datastore.User, error)
- func (mem *Store) UserUpdate(user datastore.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NonceStore ¶
type NonceStore struct {
DB *Store
}
NonceStore is a nonce store backed by database
func (*NonceStore) Accept ¶
func (s *NonceStore) Accept(endpoint, nonce string) error
Accept implements openid.NonceStore.Accept
type Store ¶
type Store struct { Users []datastore.User Orgs []datastore.Organization OrgUsers []datastore.OrganizationUser Settings map[string]string // contains filtered or unexported fields }
Store implements an in-memory store for testing
func (*Store) CreateUser ¶
CreateUser creates a new user
func (*Store) GetSettings ¶
GetSettings gets all the settings from the DataStore
func (*Store) OpenIDNonceStore ¶
func (mem *Store) OpenIDNonceStore() openid.NonceStore
OpenIDNonceStore returns an openid nonce store
func (*Store) OrgUserAccess ¶
OrgUserAccess checks if the user has permissions to access the organization
func (*Store) OrganizationCreate ¶
func (mem *Store) OrganizationCreate(org datastore.Organization) error
OrganizationCreate creates a new organization
func (*Store) OrganizationForUserToggle ¶
OrganizationForUserToggle toggles the user access for an organization
func (*Store) OrganizationGet ¶
func (mem *Store) OrganizationGet(orgID string) (datastore.Organization, error)
OrganizationGet returns an organization
func (*Store) OrganizationUpdate ¶
func (mem *Store) OrganizationUpdate(org datastore.Organization) error
OrganizationUpdate updates an organization
func (*Store) OrganizationsForUser ¶
func (mem *Store) OrganizationsForUser(username string) ([]datastore.Organization, error)
OrganizationsForUser returns the organizations a user can access
func (*Store) UserDelete ¶
UserDelete removes a user