data

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ModuleName = "identity"
)

Variables

This section is empty.

Functions

func GetOffsetLinksForPGParams

func GetOffsetLinksForPGParams(r *http.Request, p pgdb.OffsetPageParams) *resources.Links

Types

type ModulePayload

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

	//other fields that are required for module
	Username *string `json:"username"`
	Phone    *string `json:"phone"`
}

type OrderType

type OrderType string

OrderType - represents sorting order of the query

const (
	// OrderAsc - ascending order
	OrderAsc OrderType = "asc"
	// OrderDesc - descending order
	OrderDesc OrderType = "desc"
)

func (OrderType) Invert

func (o OrderType) Invert() OrderType

Invert - inverts order by

type User

type User struct {
	Id       int64   `db:"id" structs:"-"`
	Name     string  `db:"name" structs:"name"`
	Surname  string  `db:"surname" structs:"surname"`
	Telegram *string `db:"telegram" structs:"telegram"`
	Position string  `db:"position" structs:"position"`
}

type UserSelector

type UserSelector struct {
	OffsetParams *pgdb.OffsetPageParams
	Name         *string
	Surname      *string
	Position     *string
	Search       *string
}

UserSelector is a structure for all applicable filters and params

type UsersQ

type UsersQ interface {
	New() UsersQ

	Create(user User) (int64, error)
	Delete(id int64) error
	Update(user User) error
	UpdateTelegram(user User) error
	GetById(id int64) (*User, error)

	GetTotalCount() (int64, error)

	Select(selector UserSelector) ([]User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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