models

package
v0.0.0-...-4e22f25 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleUser     = "user"
	RoleOperator = "operator"
)

Variables

View Source
var AllTasks = []Task{TaskOne, TaskTwo, TaskThree}
View Source
var Manager = User{
	ID:    3,
	Login: "operator",
	Role:  RoleOperator,
}
View Source
var MessageFour = Message{
	ID:         4,
	TaskID:     3,
	FromUserID: 3,
	Text:       "message four",
	FileKey:    "",
	Created:    time.Now(),
}
View Source
var MessageOne = Message{
	ID:         1,
	TaskID:     1,
	FromUserID: 1,
	Text:       "message one",
	FileKey:    "fileone.txt",
	Created:    time.Now(),
}
View Source
var MessageThree = Message{
	ID:         3,
	TaskID:     2,
	FromUserID: 3,
	Text:       "message three",
	FileKey:    "filethree.txt",
	Created:    time.Now(),
}
View Source
var MessageTwo = Message{
	ID:         2,
	TaskID:     1,
	FromUserID: 2,
	Text:       "message two",
	FileKey:    "filetwo.txt",
	Created:    time.Now(),
}
View Source
var TaskOne = Task{
	ID:        1,
	UserID:    1,
	Name:      "task one",
	Category:  "find a doctor",
	Status:    "processing",
	StartedAt: time.Now(),
	UpdatedAt: time.Now(),
}
View Source
var TaskThree = Task{
	ID:        3,
	UserID:    2,
	Name:      "task three",
	Category:  "find a dog sitter",
	Status:    "processing",
	StartedAt: time.Now(),
	UpdatedAt: time.Now(),
}
View Source
var TaskTwo = Task{
	ID:        2,
	UserID:    1,
	Name:      "task two",
	Category:  "buy plane tickets",
	Status:    "processing",
	StartedAt: time.Now(),
	UpdatedAt: time.Now(),
}
View Source
var UserOne = User{
	ID:    1,
	Login: "userone",
	Role:  RoleUser,
}
View Source
var UserTwo = User{
	ID:    2,
	Login: "usertwo",
	Role:  RoleUser,
}

Functions

This section is empty.

Types

type Message

type Message struct {
	ID         int64     `json:"id"`
	TaskID     int64     `json:"task_id"`
	FromUserID int64     `json:"from_user_id"`
	Text       string    `json:"message_text"`
	FileKey    string    `json:"file_key"`
	Created    time.Time `json:"created_at"`
}

type Task

type Task struct {
	ID        int64     `json:"id"`
	UserID    int64     `json:"user_id"`
	Name      string    `json:"name"`
	Category  string    `json:"category"`
	Status    string    `json:"status"`
	StartedAt time.Time `json:"started_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type User

type User struct {
	ID    int64
	Login string
	Role  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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