models

package
v0.0.0-...-431722a Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModToProto

func ModToProto(mod *Mod) *protobuffer.Mod

func ModsToProto

func ModsToProto(mods []*Mod) []*protobuffer.Mod

Types

type ListQuery

type ListQuery struct {
	Size    int    `query:"size" json:"size,omitempty"`
	Page    int    `query:"page" json:"page,omitempty"`
	OrderBy string `query:"orderBy" json:"orderBy,omitempty"`
}

func (*ListQuery) GetLimit

func (q *ListQuery) GetLimit() int

GetLimit Get limit

func (*ListQuery) GetOffset

func (q *ListQuery) GetOffset() int

GetOffset Get offset

func (*ListQuery) GetOrderBy

func (q *ListQuery) GetOrderBy() string

GetOrderBy Get OrderBy

func (*ListQuery) GetPage

func (q *ListQuery) GetPage() int

GetPage Get OrderBy

func (*ListQuery) GetSize

func (q *ListQuery) GetSize() int

GetSize Get OrderBy

type ListResult

type ListResult[T any] struct {
	Size       int   `json:"size,omitempty" bson:"size"`
	Page       int   `json:"page,omitempty" bson:"page"`
	TotalItems int64 `json:"totalItems,omitempty" bson:"totalItems"`
	TotalPage  int   `json:"totalPage,omitempty" bson:"totalPage"`
	Items      []T   `json:"items,omitempty" bson:"items"`
}

func NewListResult

func NewListResult[T any](items []T, size int, page int, totalItems int64) *ListResult[T]

type Mod

type Mod struct {
	ID                string    `json:"id"`
	Name              string    `json:"name"`
	Description       string    `json:"description"`
	ModTypeCategoryID uuid.UUID `json:"modTypeCategoryID"`

	ReleaseYear int16     `json:"releaseYear"`
	CreateAt    time.Time `json:"createAt"`
}

Jump to

Keyboard shortcuts

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