db

package
v0.0.0-...-4ec4997 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() *r.Session

Types

type IRole

type IRole interface {
	Create(ctx context.Context, args model.Role) (*model.Role, error)
	Update(ctx context.Context, args model.UpdateRole) (*model.Role, error)
	Delete(ctx context.Context, filter map[string]interface{}) error
	Get(ctx context.Context, filter map[string]interface{}) (*model.Role, error)
	All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.Role, error)
	Search(ctx context.Context, query string) ([]*model.Role, error)
}

type ITodo

type ITodo interface {
	Create(ctx context.Context, args model.Todo) (*model.Todo, error)
	Update(ctx context.Context, args model.Todo) (*model.Todo, error)
	Delete(ctx context.Context, filter map[string]interface{}) error
	Get(ctx context.Context, filter map[string]interface{}) (*model.Todo, error)
	All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.Todo, error)
	Search(ctx context.Context, query string) ([]*model.Todo, error)
}

type IUser

type IUser interface {
	Create(ctx context.Context, args model.User) (*model.User, error)
	Update(ctx context.Context, args model.User) (*model.User, error)
	Delete(ctx context.Context, filter map[string]interface{}) error
	Get(ctx context.Context, filter map[string]interface{}) (*model.User, error)
	All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.User, error)
	Search(ctx context.Context, query string) ([]*model.User, error)
	CheckPassword(ctx context.Context, password, hash string) bool
}

type RoleManager

type RoleManager struct {
	Session *rd.Session
	// contains filtered or unexported fields
}

func NewRoleManager

func NewRoleManager(session *rd.Session, tblName string) *RoleManager

func (RoleManager) All

func (r RoleManager) All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.Role, error)

func (RoleManager) Create

func (r RoleManager) Create(ctx context.Context, args model.Role) (*model.Role, error)

func (RoleManager) Delete

func (r RoleManager) Delete(ctx context.Context, filter map[string]interface{}) error

func (RoleManager) Get

func (r RoleManager) Get(ctx context.Context, filter map[string]interface{}) (*model.Role, error)

func (RoleManager) Search

func (r RoleManager) Search(ctx context.Context, query string) ([]*model.Role, error)

func (RoleManager) Update

func (r RoleManager) Update(ctx context.Context, args model.UpdateRole) (*model.Role, error)

type TodoManager

type TodoManager struct {
	Session *r.Session
	// contains filtered or unexported fields
}

func NewTodoManager

func NewTodoManager(session *r.Session, tblName string) *TodoManager

func (TodoManager) All

func (t TodoManager) All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.Todo, error)

func (TodoManager) Create

func (t TodoManager) Create(ctx context.Context, args model.Todo) (*model.Todo, error)

func (TodoManager) Delete

func (t TodoManager) Delete(ctx context.Context, filter map[string]interface{}) error

func (TodoManager) Get

func (t TodoManager) Get(ctx context.Context, filter map[string]interface{}) (*model.Todo, error)

func (TodoManager) Search

func (t TodoManager) Search(ctx context.Context, query string) ([]*model.Todo, error)

func (TodoManager) Update

func (t TodoManager) Update(ctx context.Context, args model.Todo) (*model.Todo, error)

type UserManager

type UserManager struct {
	Session *r.Session
	// contains filtered or unexported fields
}

func NewUserManager

func NewUserManager(session *r.Session, tblName string) *UserManager

func (*UserManager) All

func (u *UserManager) All(ctx context.Context, filter map[string]interface{}, limit int, page int) ([]*model.User, error)

func (*UserManager) CheckPassword

func (u *UserManager) CheckPassword(ctx context.Context, password string, hash string) bool

CheckPassword compare the stored and the incoming password tp match a specific user account

func (*UserManager) Create

func (u *UserManager) Create(ctx context.Context, args model.User) (*model.User, error)

func (*UserManager) Delete

func (u *UserManager) Delete(ctx context.Context, filter map[string]interface{}) error

func (*UserManager) Get

func (u *UserManager) Get(ctx context.Context, filter map[string]interface{}) (*model.User, error)

func (*UserManager) Search

func (u *UserManager) Search(ctx context.Context, query string) ([]*model.User, error)

func (*UserManager) Update

func (u *UserManager) Update(ctx context.Context, args model.User) (*model.User, error)

Jump to

Keyboard shortcuts

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