data

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "unverified"

Variables

This section is empty.

Functions

Types

type ModulePayload

type ModulePayload struct {
	RequestId string `json:"request_id"`
	Action    string `json:"action"`

	//other fields that are required for module
	Users []User `json:"users"`
}

type ModuleRequest

type ModuleRequest struct {
	ID            string    `db:"id" structs:"id"`
	UserID        int64     `db:"user_id" structs:"user_id"`
	Module        string    `db:"module" structs:"module"`
	Payload       string    `db:"payload" structs:"payload"`
	CreatedAt     time.Time `db:"created_at" structs:"created_at"`
	RequestStatus string    `db:"request_status" structs:"request_status"`
	Error         string    `db:"error" structs:"error"`
}

type SortParams

type SortParams struct {
	Param string `page:"sort" default:"created_at"`
}

type User

type User struct {
	Id        int64     `json:"-" db:"id" structs:"-"`
	Username  *string   `json:"username" db:"username" structs:"username,omitempty"`
	Phone     *string   `json:"phone" db:"phone" structs:"phone,omitempty"`
	Email     *string   `json:"email" db:"email" structs:"email,omitempty"`
	Name      *string   `json:"name" db:"name" structs:"name,omitempty"`
	Module    string    `json:"module" db:"module" structs:"module"`
	Submodule string    `json:"submodule" db:"submodule" structs:"submodule"`
	ModuleId  string    `json:"module_id" db:"module_id" structs:"module_id"`
	CreatedAt time.Time `json:"created_at" db:"created_at" structs:"-"`
}

type Users

type Users interface {
	New() Users

	Upsert(user User) error
	Delete() error
	Select() ([]User, error)
	Get() (*User, error)

	WithGroupedModulesAndSubmodules(modules *string) Users
	WithGroupedSubmodules(username, module *string) Users

	FilterByModuleIds(moduleIds ...string) Users
	FilterByModules(modules ...string) Users

	SearchBy(search string) Users

	CountWithGroupedModules(modules *string) Users
	GetTotalCount() (int64, error)

	Page(pageParams pgdb.OffsetPageParams, sortParams SortParams) Users
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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