Documentation ¶
Overview ¶
datastore package auth.go - datastore layer for authentification
package datastore user.go - implementing standar CRUD operation for user NOTE of method:
- Get method
- Gets method
- Update method
- Delete method
- CheckCredential for login/signin operation
- UserActivation method
- UserExist method
package datastore user.role.go - implementing standar CRUD operation for user.role
datastore package user.status.go - read only persistent/ datastore layer for user.status model
Index ¶
- type IUserRoleStore
- type IUserStatusStore
- type IUserStore
- type UserRoleStore
- func (st *UserRoleStore) Create(input d.UserRole) (*d.UserRole, error)
- func (st *UserRoleStore) Delete(id int) (*d.UserRole, error)
- func (st *UserRoleStore) Get(id int) (*d.UserRole, error)
- func (st *UserRoleStore) Gets() ([]*d.UserRole, error)
- func (st *UserRoleStore) Update(id int, input d.UserRole) (*d.UserRole, error)
- type UserStatusStore
- type UserStore
- func (st *UserStore) Create(input d.User) (*d.User, error)
- func (st *UserStore) Delete(id uuid.UUID) (*d.User, error)
- func (st *UserStore) Get(id uuid.UUID) (*d.User, error)
- func (st *UserStore) GetByEmail(email string) (*d.UserCredential, error)
- func (st *UserStore) GetCredential(username, passkey string) (*d.UserCredential, error)
- func (st *UserStore) Gets() ([]*d.User, error)
- func (st *UserStore) IsUserExist(username, email string) (bool, error)
- func (st *UserStore) Update(id uuid.UUID, input d.User) (*d.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IUserRoleStore ¶
type IUserRoleStore interface { // Create will execute sql query insert new user record into database Create(input d.UserRole) (*d.UserRole, error) // Get will execute sql query to get user record from database // based on the given id Get(id int) (*d.UserRole, error) // Gets will execute sql query to get all user record from database Gets() ([]*d.UserRole, error) // Update will execute sql query to update user record // based on given input id and input data Update(id int, input d.UserRole) (*d.UserRole, error) // Delete will do 'soft delete' instead of deleting the user record // from the database. Data should be persistant in the database Delete(id int) (*d.UserRole, error) }
IUserRoleStore is user.role interface for CRUD operation directly to the database
type IUserStatusStore ¶
type IUserStatusStore interface { // Get will execute sql query to get user record from database // based on the given id Get(id int) (*d.UserStatus, error) // Gets will execute sql query to get all user record from database Gets() ([]*d.UserStatus, error) }
IUserStatusStores is user.status interface for 'Read' / 'Get' operation directly to the database
type IUserStore ¶
type IUserStore interface { // Create will execute sql query to insert new user record into the database Create(input d.User) (*d.User, error) // Get will execute sql query to get user record from database // based on the given id Get(id uuid.UUID) (*d.User, error) // GetByEmail will get credential data by email from user record GetByEmail(email string) (*d.UserCredential, error) // Gets will execute sql query to get all user record from database Gets() ([]*d.User, error) // Update will execute sql query to update user record // based on given input id and input data Update(id uuid.UUID, input d.User) (*d.User, error) // Delete will do 'soft delete' instead of deleting the user record // from the database. Data should be persistant in the database Delete(id uuid.UUID) (*d.User, error) // GetCredential will get credential data from user record GetCredential(username, passkey string) (*d.UserCredential, error) // IsUserExist will check whether username/ email is already exist IsUserExist(username, email string) (bool, error) }
IUserStore is user interface for CRUD operation directly to the database
type UserRoleStore ¶
UserRoleStore is instance wrapper for IDatabase interface
func NewUserRoleStore ¶
func NewUserRoleStore(iDB database.IDatabase) *UserRoleStore
NewUserRoleStore will create instance of UserRoleStore
func (*UserRoleStore) Delete ¶
func (st *UserRoleStore) Delete(id int) (*d.UserRole, error)
Delete will 'soft' delete user role record data based on its given 'id'
func (*UserRoleStore) Get ¶
func (st *UserRoleStore) Get(id int) (*d.UserRole, error)
Get will get user.role record from the database based on its 'id'
type UserStatusStore ¶
UserStatusStore is instance wrapper for IDatabase interface
func NewUserStatusStore ¶
func NewUserStatusStore(iDB database.IDatabase) *UserStatusStore
NewUseStatusStore will create instance of UserStatusStore
func (*UserStatusStore) Get ¶
func (s *UserStatusStore) Get(id int) (*d.UserStatus, error)
Get will get user.status from the database based on its 'id'
func (*UserStatusStore) Gets ¶
func (s *UserStatusStore) Gets() ([]*d.UserStatus, error)
Gets will get all user.status record from the database
type UserStore ¶
UserStore is instance wrapper for IDatabase interface
func NewUserStore ¶
NewUserStore will create instance of UserStore
func (*UserStore) GetByEmail ¶
func (st *UserStore) GetByEmail(email string) (*d.UserCredential, error)
GetByEmail will get user credential by username
func (*UserStore) GetCredential ¶
func (st *UserStore) GetCredential(username, passkey string) (*d.UserCredential, error)
GetCredential will get user credential data
func (*UserStore) IsUserExist ¶
UserExist will check whether username/ email already exist