mysql

package
v1.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	Runtime *env.Runtime
}

Scope provides data access to MySQL.

func (Scope) Add

func (s Scope) Add(ctx domain.RequestContext, account account.Account) (err error)

Add inserts the given record into the datbase account table.

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

func (s Scope) DeleteAccount(ctx domain.RequestContext, ID string) (rows int64, err error)

DeleteAccount deletes the database record in the account table for user ID.

func (Scope) GetAccountsByOrg

func (s Scope) GetAccountsByOrg(ctx domain.RequestContext) (t []account.Account, err error)

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

func (s Scope) UpdateAccount(ctx domain.RequestContext, account account.Account) (err error)

UpdateAccount updates the database record for the given account to the given values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL