Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountProto ¶
AccountProto converts account db model to protobuf Account message
func AccountProtoView ¶
AccountProtoView returns the appropriate view
func NewAccountAPI ¶
NewAccountAPI creates an account API singleton
Types ¶
type Account ¶
type Account struct { AccountID uint `gorm:"primaryKey;autoIncrement"` ProjectID string `gorm:"index;type:varchar(50);not null"` GroupID string `gorm:"index;type:varchar(50)"` ParentID string `gorm:"index;type:varchar(50)"` Email string `gorm:"index;type:varchar(50);not null"` Phone string `gorm:"index;type:varchar(50);not null"` DeviceToken string `gorm:"type:varchar(256)"` Names string `gorm:"type:varchar(50);not null"` BirthDate string `gorm:"type:varchar(30);"` Gender string `gorm:"index;type:enum('GENDER_UNSPECIFIED', 'MALE', 'FEMALE');default:'GENDER_UNSPECIFIED';not null"` IDNumber string `gorm:"index;type:varchar(15)"` Profession string `gorm:"type:varchar(50)"` Residence string `gorm:"type:varchar(100)"` Nationality string `gorm:"type:varchar(50);default:'Kenyan'"` ProfileURL string `gorm:"type:varchar(256)"` LinkedAccounts string `gorm:"type:varchar(256)"` SecurityQuestion string `gorm:"type:varchar(50)"` SecurityAnswer string `gorm:"type:varchar(50)"` Password string `gorm:"type:text"` PrimaryGroup string `gorm:"index;type:varchar(50);not null"` SecondaryGroups []byte `gorm:"type:json"` AccountState string `gorm:"index;type:enum('BLOCKED','ACTIVE', 'INACTIVE');not null;default:'INACTIVE'"` LastLogin *time.Time CreatedAt time.Time `gorm:"index;type:datetime(6);not null"` UpdatedAt time.Time `gorm:"type:datetime(6)"` DeletedAt gorm.DeletedAt }
Account contains profile information stored in the database
func AccountModel ¶
AccountModel converts protobuf Account message to account db model
func (*Account) AfterCreate ¶
AfterCreate is a callback after creating object
type Options ¶
type Options struct { AppName string EmailDisplayName string DefaultEmailSender string TemplatesDir string ActivationURL string PaginationHasher *hashids.HashID AuthAPI auth.API SQLDBWrites *gorm.DB SQLDBReads *gorm.DB RedisDBWrites *redis.Client RedisDBReads *redis.Client SecureCookie *securecookie.SecureCookie Logger grpclog.LoggerV2 MessagingClient messaging.MessagingClient FirebaseAuth fauth.FirebaseAuthClient }
Options contain parameters for NewAccountAPI
Source Files ¶
Click to show internal directories.
Click to hide internal directories.