model

package
v0.0.0-...-7e332dc Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

type Label struct {
	ID          primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	User        primitive.ObjectID `json:"user" bson:"user,omitempty"`
	Name        string             `json:"name" bson:"name,omitempty" validate:"required,max=100,min=2"`
	Description string             `json:"description" bson:"description" validate:"max=100"`
}

type Setting

type Setting struct {
	ID                primitive.ObjectID `bson:"id,omitempty"`
	LongBreakLength   int                `json:"longBreakLength" bson:"long_break_length,omitempty" validate:"required,numeric,isdefault=15"`
	ShortBreakLength  int                `json:"shortBreakLength" bson:"short_break_length,omitempty" validate:"required,numeric,isdefault=5"`
	PomodoroLength    int                `json:"pomodoroLength" bson:"pomodoro_length,omitempty" validate:"required,numeric,isdefault=25"`
	AlarmSound        bool               `json:"alarmSound" bson:"alarm_sound,omitempty" validate:"required,boolean"`
	Notification      bool               `json:"notification" bson:"notification,omitempty" validate:"required,boolean"`
	LongBreakInterval int                `json:"longBreakInterval" bson:"long_break_interval,omitempty" validate:"required,isdefault=4"`
}

type Timer

type Timer struct {
	StartTime  time.Time `json:"startTime" bson:"start_time" validate:"datetime"`
	PausedTime time.Time `json:"pausedTime" bson:"paused_time" validate:"datetime"`
	TimerCode  string    `json:"timerCode" bson:"timer_code" validate:"required,pomodoro|shortBreak|longBreak"`
}

type User

type User struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	UserID      uuid.UUID          `json:"userID" bson:"user_id"`
	FirstName   string             `json:"firstName" bson:"first_name,omitempty" validate:"required,max=50,min=2"`
	LastName    string             `json:"lastName" bson:"last_name,omitempty" validate:"required,max=50,min=2"`
	Username    string             `json:"username" bson:"username,omitempty" validate:"required,max=50,min=2"`
	Email       string             `json:"email" bson:"email,omitempty" validate:"required,email,max=100,min=10"`
	Password    string             `json:"password" bson:"password,omitempty"`
	Activated   bool               `json:"activated" bson:"activated"`
	CreatedAt   time.Time          `json:"createdAt" bson:"created_at,omitempty" validate:"required"`
	UpdatedAt   time.Time          `json:"updatedAt" bson:"updated_at"`
	Description string             `json:"description" bson:"description"`
	Setting     Setting            `json:"setting" bson:"setting,inline"`
	Timer       Timer              `json:"timer" bson:"timer"`
}

Jump to

Keyboard shortcuts

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