models

package
v0.0.0-...-04c0119 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID        string    `json:"id,omitempty"`
	Title     string    `json:"title,omitempty" validate:"omitempty,min=3,max=40"`
	Text      string    `json:"text,omitempty" validate:"omitempty,min=5,max=700"`
	Creator   string    `json:"user,omitempty" validate:"omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

Post describes the globally used Post type.

type User

type User struct {
	ID        string    `json:"id,omitempty"`
	Name      string    `json:"name" validate:"omitempty,min=3,max=20"`
	Email     string    `json:"email" validate:"omitempty,email"`
	Password  string    `json:"password,omitempty" validate:"omitempty,min=8,max=24"`
	Roles     []string  `json:"roles" validate:"omitempty,dive,eq=user"`
	CreatedAt time.Time `json:"created_at"`
}

User describes the globally used User type.

Jump to

Keyboard shortcuts

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