Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyEmail = errors.New("empty email") ErrWrongEmailFormat = errors.New("wrong email format") )
View Source
var ( ErrEmptyPassword = errors.New("empty password") ErrWrongPasswordFormat = errors.New("wrong password format") )
View Source
var ( ErrEmptyName = errors.New("empty name") ErrWrongNameFormat = errors.New("wrong name format") )
View Source
var ( ErrTextTooLong = errors.New("text too long") MaxTextLen = 500 )
View Source
var (
ErrEmptyLabel = errors.New("label can not be empty!")
)
View Source
var ErrIdMustBeOmitted = errors.New("id must be omitted")
View Source
var ErrIdMustBePresent = errors.New("id must be present")
View Source
var ErrInvalidId = errors.New("invalid id")
Functions ¶
func ErrInvalidCast ¶
func ErrInvalidCast(got, expected interface{}) error
Helper to generate error message about bad cast.
Types ¶
type LabelsList ¶
type LabelsList []Label
type Project ¶
type Project struct {
Id AutoId `json:"_id,omitempty" bson:"_id,omitempty"`
Title Name `json:"title" bson:"title"`
Description Text `json:"description,omitempty" bson:"description,omitempty"`
Users []RequiredId `json:"users,omitempty" bson:"users,omitempty"`
Tasks []RequiredId `json:"tasks,omitempty" bson:"tasks,omitempty"`
}
func SafeCastToProject ¶
type ProjectUser ¶
type ProjectUser struct {
ProjectId RequiredId
UserId RequiredId
}
Helper for both project and user ids.
func SafeCastToProjectUser ¶
func SafeCastToProjectUser(data interface{}) (ProjectUser, error)
type ProjectsList ¶
type ProjectsList []Project
type RequiredId ¶
type RequiredId struct{ Id }
RequiredId helpers
func SafeCastToRequiredId ¶
func SafeCastToRequiredId(data interface{}) (RequiredId, error)
type Task ¶
type Task struct {
Id AutoId `json:"_id,omitempty" bson:"_id,omitempty"`
Title Name `json:"title" bson:"title"`
ProjectId RequiredId `json:"project_id" bson:"project_id"`
Description Text `json:"description,omitempty" bson:"description,omitempty"`
InitiatorId RequiredId `json:"initiator_id" bson:"initiator_id"`
AssigneeId OptionalId `json:"assignee_id,omitempty" bson:"assignee_id,omitempty"`
Labels LabelsList `json:"labels,omitempty" bson:"labels,omitempty"`
}
func SafeCastToTask ¶
type User ¶
type User struct {
Id AutoId `json:"_id" bson:"_id,omitempty"`
Email Email `json:"email" bson:"email"`
Password Password `json:"password,omitempty" bson:"password"`
Name Name `json:"name" bson:"name"`
Bio Text `json:"bio,omitempty" bson:"bio,omitempty"`
Projects []RequiredId `json:"projects,omitempty" bson:"projects,omitempty"`
}
func SafeCastToUser ¶
Click to show internal directories.
Click to hide internal directories.