Documentation ¶
Index ¶
- type Scope
- func (s Scope) Add(ctx domain.RequestContext, account account.Account) (err error)
- func (s Scope) CountOrgAccounts(ctx domain.RequestContext) (c int)
- func (s Scope) DeleteAccount(ctx domain.RequestContext, ID string) (rows int64, err error)
- func (s Scope) GetAccountsByOrg(ctx domain.RequestContext) (t []account.Account, err error)
- func (s Scope) GetUserAccount(ctx domain.RequestContext, userID string) (account account.Account, err error)
- func (s Scope) GetUserAccounts(ctx domain.RequestContext, userID string) (t []account.Account, err error)
- func (s Scope) HasOrgAccount(ctx domain.RequestContext, orgID, userID string) bool
- func (s Scope) UpdateAccount(ctx domain.RequestContext, account account.Account) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
Scope provides data access to MySQL.
func (Scope) CountOrgAccounts ¶
func (s Scope) CountOrgAccounts(ctx domain.RequestContext) (c int)
CountOrgAccounts returns the numnber of active user accounts for specified organization.
func (Scope) DeleteAccount ¶
DeleteAccount deletes the database record in the account table for user ID.
func (Scope) GetAccountsByOrg ¶
GetAccountsByOrg returns a slice of database account records, for all users in the client's organization.
func (Scope) GetUserAccount ¶
func (s Scope) GetUserAccount(ctx domain.RequestContext, userID string) (account account.Account, err error)
GetUserAccount returns the database account record corresponding to the given userID, using the client's current organizaion.
func (Scope) GetUserAccounts ¶
func (s Scope) GetUserAccounts(ctx domain.RequestContext, userID string) (t []account.Account, err error)
GetUserAccounts returns a slice of database account records, for all organizations that the userID is a member of, in organization title order.
func (Scope) HasOrgAccount ¶
func (s Scope) HasOrgAccount(ctx domain.RequestContext, orgID, userID string) bool
HasOrgAccount returns if the given orgID has valid userID.
func (Scope) UpdateAccount ¶
UpdateAccount updates the database record for the given account to the given values.