storage

package
v0.0.0-...-6c8972c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pass     string = "PASS"
	TOTP     string = "TOTP"
	PINCode  string = "CODE"
	SMS      string = "SMS"
	Recovery string = "RECOVERY"
	EMail    string = "EMAIL"
)
View Source
const PAGESIZE int = 10

Variables

View Source
var (
	// NotFound is returned when the requested resource does not exist.
	NotFound = status.Error(codes.NotFound, "not found")
	// Conflict is returned when trying to create the same resource twice.
	Conflict = status.Error(codes.AlreadyExists, "conflict")
	// UsernameExists is returned when the username already exists in storage.
	UsernameExists = errors.New("username already exists")
	// EmailExists is returned when signup email already exists in storage.
	EmailExists = errors.New("email already exists")
	// InvCodeExists is returned when invitation code already exists in storage.
	InvCodeExists = errors.New("invitation code already exists")
	// Triggers when request arguments are invalid
	InvalidArgument = status.Error(codes.InvalidArgument, "invalid arguments")
)
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type ActiveStatus

type ActiveStatus int32
const (
	Active ActiveStatus
	Inactive
)

type Credential

type Credential struct {
	ID            string       `db:"id"`
	Username      string       `db:"username"`
	Password      string       `db:"password"`
	Deleted       sql.NullTime `db:"deleted"`
	LastLogin     sql.NullTime `db:"last_login"`
	LastFailed    sql.NullTime `db:"last_failed"`
	ResetRequired sql.NullTime `db:"reset_required"`
	FailCount     int          `db:"fail_count"`
	EmailVerified bool         `db:"email_verified"`
}

type FilterUser

type FilterUser struct {
	SearchTerm   string
	Limit        int32
	Offset       int32
	SortBy       string
	SortByColumn string
	Status       ActiveStatus
	StartDate    string
	EndDate      string
}

type ListRoleFilter

type ListRoleFilter struct {
	SortBy     string `db:"sort_by"`
	SearchTerm string `db:"search_term"`
	Limit      int32  `db:"limit"`
	Offset     int32  `db:"offset"`
	Status     int32  `db:"status"`
}

type ResAct

type ResAct struct {
	Resource string
	Action   string
	Public   bool
}

type Role

type Role struct {
	ID          string         `db:"id"`
	RoleName    string         `db:"name"`
	Description string         `db:"description"`
	Access      string         `db:"access"`
	Status      int32          `db:"status"`
	CreatedAt   time.Time      `db:"created_at"`
	CreatedBy   string         `db:"created_by"`
	UpdatedAt   time.Time      `db:"updated_at"`
	UpdatedBy   string         `db:"updated_by"`
	Delete      sql.NullTime   `db:"deleted_at,omitempty"`
	DeleteUID   sql.NullString `db:"deleted_by,omitempty"`
	Count       int
}

type User

type User struct {
	ID        string         `db:"id"`
	Username  string         `db:"username"`
	Email     string         `db:"email"`
	Password  string         `db:"password"`
	Image     string         `db:"image"`
	Status    int32          `db:"status"`
	IsMFA     bool           `db:"is_mfa"`
	MFAType   string         `db:"mfa_type"`
	CreatedAt time.Time      `db:"created_at"`
	CreatedBy string         `db:"created_by"`
	UpdatedAt time.Time      `db:"updated_at"`
	UpdatedBy sql.NullString `db:"updated_by"`
	DeletedAt sql.NullTime   `db:"deleted_at,omitempty"`
	DeletedBy sql.NullString `db:"deleted_by,omitempty"`
	RoleNames sql.NullString `db:"role_names"`
	Count     int32
	RoleID    []string
}

type UserInformation

type UserInformation struct {
	ID        string         `db:"id"`
	UserID    string         `db:"user_id"`
	Username  string         `db:"username"`
	Image     string         `db:"image"`
	FirstName string         `db:"first_name"`
	LastName  string         `db:"last_name"`
	Email     string         `db:"email"`
	Mobile    string         `db:"mobile"`
	Gender    int            `db:"gender"`
	DOB       time.Time      `db:"dob"`
	Address   string         `db:"address"`
	City      string         `db:"city"`
	Country   string         `db:"country"`
	CreatedAt time.Time      `db:"created_at"`
	CreatedBy string         `db:"created_by"`
	UpdatedAt time.Time      `db:"updated_at"`
	UpdatedBy sql.NullString `db:"updated_by"`
	DeletedAt sql.NullTime   `db:"deleted_at,omitempty"`
	DeletedBy sql.NullString `db:"deleted_by,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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