Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnonymousUser = &User{}
Functions ¶
func ValidateFilters ¶
func ValidateFilters(v *validator.MyValidator, f Filters)
Types ¶
type Categories ¶
type Categories []string
var CategoriesList Categories = []string{
"Sport",
"Home",
"Work",
}
func (Categories) GetCategory ¶
func (c Categories) GetCategory(categoryId uint8) (string, error)
func (Categories) IsValidCategory ¶
func (c Categories) IsValidCategory(categoryId uint8) bool
type Metadata ¶
type Metadata struct { CurrentPage uint32 `json:"current_page,omitempty"` PageSize uint32 `json:"page_size,omitempty"` FirstPage uint32 `json:"first_page,omitempty"` LastPage uint32 `json:"last_page,omitempty"` TotalRecords uint32 `json:"total_records,omitempty"` }
Metadata defines a new struct for holding the pagination metadata.
func CalculateMetadata ¶
type Paste ¶
type Paste struct { Id uint16 `json:"id"` Title string `json:"title"` Category uint8 `json:"category,omitempty"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` ExpiresAt time.Time `json:"expires_at"` Minutes int32 `json:"-"` Version uint32 `json:"version"` CanEdit bool `json:"can_edit"` }
type Permission ¶
Click to show internal directories.
Click to hide internal directories.