models

package
v0.0.0-...-372eb2b Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFilters

func ValidateFilters(v *validator.Validator, filters Filters)

Types

type Article

type Article struct {
	ID      primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Title   string             `bson:"title" json:"title"`
	Content string             `bson:"content,omitempty" json:"content"`
	Tags    []string           `bson:"tags,omitempty" json:"tags"`
	Author  string             `bson:"author" json:"author"`
	Status  string             `bson:"status" json:"status"`
	Created time.Time          `bson:"created" json:"created"`
	Updated time.Time          `bson:"updated,omitempty" json:"updated,omitempty"`
	Version int                `bson:"version" json:"version"`
}

type Filters

type Filters struct {
	Page         int
	PageSize     int
	Sort         string
	SortSafeList []string
}

func (Filters) Limit

func (f Filters) Limit() int

func (Filters) Offset

func (f Filters) Offset() int

func (Filters) SortDirection

func (f Filters) SortDirection() int

func (Filters) SortField

func (f Filters) SortField() string

type Subscriber

type Subscriber struct {
	ID      primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Email   string             `bson:"email" json:"email"`
	Created time.Time          `bson:"created" json:"created"`
}

Jump to

Keyboard shortcuts

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