Documentation ¶
Index ¶
- Constants
- type Account
- type AccountDB
- func (a *AccountDB) BuildSearchQuery(qs string) string
- func (a *AccountDB) DeleteAccount(id string) error
- func (a *AccountDB) DeleteOrg(id string) error
- func (a *AccountDB) DeleteProject(id string) error
- func (a *AccountDB) DeleteRole(id string) error
- func (a *AccountDB) FetchRoles(accountId string) ([]*Role, error)
- func (a *AccountDB) FromPkgNewRoleRequest(role *rpc.NewUserRoles, accountId string) *Role
- func (a *AccountDB) FromPkgRoleRequest(role *rpc.UserRoles, accountId string) *Role
- func (a *AccountDB) FromRpcAccount(account *accountRpc.Account) (*Account, error)
- func (a *AccountDB) FromRpcOrgRequestToQueryFilter(org *rpc.OrgRequest) (*coresvc.QueryParams, error)
- func (a *AccountDB) FromRpcProject(p *rpc.ProjectRequest) (*Project, error)
- func (a *AccountDB) FromrpcOrgRequest(org *rpc.OrgRequest, id string) (*Org, error)
- func (a *AccountDB) GetAccount(filterParams *coresvc.QueryParams) (*Account, error)
- func (a *AccountDB) GetLoginAttempt(originIp string) (*LoginAttempt, error)
- func (a *AccountDB) GetOrg(filterParam *coresvc.QueryParams) (*Org, error)
- func (a *AccountDB) GetProject(filterParam *coresvc.QueryParams) (*Project, error)
- func (a *AccountDB) GetRole(filterParam *coresvc.QueryParams) (*Role, error)
- func (a *AccountDB) InsertAccount(acc *Account) error
- func (a *AccountDB) InsertFromRpcAccountRequest(account *accountRpc.AccountNewRequest, verified bool) (*Account, error)
- func (a *AccountDB) InsertOrg(o *Org) error
- func (a *AccountDB) InsertProject(p *Project) error
- func (a *AccountDB) InsertRole(p *Role) error
- func (a *AccountDB) ListAccount(filterParams *coresvc.QueryParams, orderBy string, limit, cursor int64, ...) ([]*Account, int64, error)
- func (a *AccountDB) ListNonSubbed(accountId string, filterParams *coresvc.QueryParams, orderBy string, ...) ([]*Org, int64, error)
- func (a *AccountDB) ListOrg(filterParam *coresvc.QueryParams, orderBy string, limit, cursor int64, ...) ([]*Org, int64, error)
- func (a *AccountDB) ListProject(filterParam *coresvc.QueryParams, orderBy string, limit, cursor int64, ...) ([]*Project, int64, error)
- func (a *AccountDB) ListRole(filterParam *coresvc.QueryParams) ([]*Role, error)
- func (a *AccountDB) ResetAll() error
- func (a *AccountDB) UpdateAccount(acc *Account) error
- func (a *AccountDB) UpdateOrg(o *Org) error
- func (a *AccountDB) UpdateProject(p *Project) error
- func (a *AccountDB) UpdateRole(p *Role) error
- func (a *AccountDB) UpsertLoginAttempt(originIp string, accountEmail string, attempt uint, banPeriod int64) (*LoginAttempt, error)
- type LoginAttempt
- type Org
- type Project
- type Role
Constants ¶
View Source
const ( AccTableName = "accounts" RolesTableName = "roles" OrgTableName = "orgs" ProjectTableName = "projects" DefaultLimit = 50 DefaultCursor = `created_at` LoginAttemptsTableName = `login_attempts` )
const.go contains all the table columns / fields basically.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id,omitempty" genji:"id" coredb:"primary"` Email string `json:"email,omitempty" genji:"email"` Password string `json:"password,omitempty" genji:"password"` CreatedAt int64 `json:"created_at" genji:"created_at"` UpdatedAt int64 `json:"updated_at" genji:"updated_at"` LastLogin int64 `json:"last_login" genji:"last_login"` Disabled bool `json:"disabled" genji:"disabled"` Verified bool `json:"verified" genji:"verified"` VerificationToken string `json:"verification_token,omitempty" genji:"verification_token"` AvatarResourceId string `json:"avatar_resource_id,omitempty" genji:"avatar_resource_id"` }
func (Account) CreateSQL ¶
CreateSQL will only be called once by sys-core see sys-core API.
func (*Account) ToRpcAccount ¶
func (a *Account) ToRpcAccount(roles []*accountRpc.UserRoles, avatar []byte) (*accountRpc.Account, error)
type AccountDB ¶
type AccountDB struct {
// contains filtered or unexported fields
}
func (*AccountDB) FromPkgNewRoleRequest ¶
func (a *AccountDB) FromPkgNewRoleRequest(role *rpc.NewUserRoles, accountId string) *Role
func (*AccountDB) FromPkgRoleRequest ¶
func (*AccountDB) FromRpcAccount ¶
func (a *AccountDB) FromRpcAccount(account *accountRpc.Account) (*Account, error)
func (*AccountDB) FromRpcOrgRequestToQueryFilter ¶
func (a *AccountDB) FromRpcOrgRequestToQueryFilter(org *rpc.OrgRequest) (*coresvc.QueryParams, error)
func (*AccountDB) FromRpcProject ¶
func (a *AccountDB) FromRpcProject(p *rpc.ProjectRequest) (*Project, error)
func (*AccountDB) FromrpcOrgRequest ¶
func (*AccountDB) GetAccount ¶
func (a *AccountDB) GetAccount(filterParams *coresvc.QueryParams) (*Account, error)
func (*AccountDB) GetLoginAttempt ¶
func (a *AccountDB) GetLoginAttempt(originIp string) (*LoginAttempt, error)
func (*AccountDB) GetOrg ¶
func (a *AccountDB) GetOrg(filterParam *coresvc.QueryParams) (*Org, error)
func (*AccountDB) GetProject ¶
func (a *AccountDB) GetProject(filterParam *coresvc.QueryParams) (*Project, error)
func (*AccountDB) GetRole ¶
func (a *AccountDB) GetRole(filterParam *coresvc.QueryParams) (*Role, error)
func (*AccountDB) InsertFromRpcAccountRequest ¶
func (a *AccountDB) InsertFromRpcAccountRequest(account *accountRpc.AccountNewRequest, verified bool) (*Account, error)
func (*AccountDB) ListAccount ¶
func (*AccountDB) ListNonSubbed ¶
func (*AccountDB) ListOrg ¶
func (*AccountDB) ListProject ¶
type LoginAttempt ¶
type LoginAttempt struct { OriginIP string `json:"origin_ip" genji:"origin_ip" coredb:"primary"` AccountEmail string `json:"account_email,omitempty" genji:"account_email"` TotalAttempts uint `json:"total_attempts" genji:"total_attempts"` BanPeriod int64 `json:"ban_period" genji:"ban_period"` }
func (LoginAttempt) CreateSQL ¶
func (l LoginAttempt) CreateSQL() []string
CreateSQL will only be called once by sys-core see sys-core API.
type Org ¶
type Org struct { Id string `genji:"id" json:"id,omitempty" coredb:"primary"` Name string `genji:"name" json:"name,omitempty"` LogoResourceId string `genji:"logo_resource_id" json:"logo_resource_id,omitempty"` Contact string `genji:"contact" json:"contact,omitempty"` CreatedAt int64 `genji:"created_at" json:"created_at"` AccountId string `genji:"account_id" json:"account_id"` }
type Project ¶
type Project struct { Id string `json:"id" genji:"id" coredb:"primary"` Name string `json:"name,omitempty" genji:"name"` LogoResourceId string `json:"logo_resource_id" genji:"logo_resource_id"` CreatedAt int64 `json:"created_at" genji:"created_at"` AccountId string `json:"account_id" genji:"account_id"` OrgId string `json:"org_id" genji:"org_id"` OrgName string `json:"org_name" genji:"org_name"` }
type Role ¶
type Role struct { ID string `genji:"id" coredb:"primary"` AccountId string `genji:"account_id"` Role int `genji:"role"` ProjectId string `genji:"project_id"` OrgId string `genji:"org_id"` CreatedAt int64 `genji:"created_at"` UpdatedAt int64 `genji:"updated_at"` }
func (Role) CreateSQL ¶
CreateSQL will only be called once by sys-core see sys-core API.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.