model

package
v0.0.0-...-a9181b3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marker

type Marker struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Icon   string `json:"icon"`
	UserID int    `json:"user_id"`
}

Marker ...

func (*Marker) Validate

func (uP *Marker) Validate() error

Validate ...

type Rating

type Rating struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	Surname     string  `json:"surname"`
	Rating      float64 `json:"rating"`
	CountCreate int     `json:"count_create"`
	CountDone   int     `json:"count_done"`
	UserID      int     `json:"user_id"`
}

Rating ...

func (*Rating) Validate

func (r *Rating) Validate() error

Validate ...

type Task

type Task struct {
	ID           int       `json:"id"`
	Time         time.Time `json:"time"`
	Date         time.Time `json:"date"`
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	MarkerIcon   string    `json:"marker_icon"`
	MarkerName   string    `json:"marker_name"`
	IsDone       bool      `json:"is_done"`
	UserID       int       `json:"user_id"`
	Rating       float64   `json:"rating"`
	TimeToFinish float64
}

Task ...

func (*Task) Validate

func (t *Task) Validate() error

Validate ...

type Token

type Token struct {
	UserID int
	Name   string
	jwt.StandardClaims
}

Token ...

type User

type User struct {
	ID                 int    `json:"id"`
	Email              string `json:"email"`
	Password           string `json:"password,omitempty"`
	EncryptedPassword  string `json:"-"`
	Token              string `json:"token"`
	Name               string `json:"name"`
	Surname            string `json:"surname"`
	TokenTG            string `json:"token_tg"`
	IsTelegramAuth     bool   `json:"is_telegram_auth"`
	ChatIDTG           int    `json:"chat_id_tg"`
	IsTelegramNotifyOn bool   `json:"is_notify_tg_on"`
}

User ...

func TestUser

func TestUser(t *testing.T) *User

TestUser ...

func TestUser2

func TestUser2(t *testing.T) *User

TestUser2 ...

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

BeforeCreate ...

func (*User) ComparePassword

func (u *User) ComparePassword(password string) bool

ComparePassword ...

func (*User) Sanitize

func (u *User) Sanitize()

Sanitize ...

func (*User) Validate

func (u *User) Validate() error

Validate ...

Jump to

Keyboard shortcuts

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