model

package
v0.0.0-...-d5bd7fa Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskStates = [...]string{
	"UNKNOWN",
	"NOT_COMPLETED",
	"COMPLETED",
}

TaskStates stringified

Functions

This section is empty.

Types

type Task

type Task struct {
	ID    primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` // ID is a unique ID for the task
	User  string             `json:"user"`                               // User to which this task belongs
	Text  string             `json:"text"`                               // Text is the user visible text for the task
	State TaskState          `json:"state"`                              // State is the current state of the task
	Due   time.Time          `json:"due"`                                // Due is the due date/time of the task
}

Task is a unique task

type TaskState

type TaskState int

TaskState type

const (
	UNKNOWN TaskState = iota
	WHISPER
	MESSAGE
)

TaskState

func TaskStateFromString

func TaskStateFromString(str string) (TaskState, error)

func (TaskState) MarshalBSONValue

func (t TaskState) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue for TaskState

func (TaskState) MarshalJSON

func (t TaskState) MarshalJSON() ([]byte, error)

MarshalJSON for TaskState

func (TaskState) String

func (t TaskState) String() string

func (*TaskState) UnmarshalBSONValue

func (t *TaskState) UnmarshalBSONValue(ty bsontype.Type, data []byte) error

UnmarshalBSONValue for TaskState

func (*TaskState) UnmarshalJSON

func (t *TaskState) UnmarshalJSON(b []byte) error

UnmarshalJSON for TaskState

Jump to

Keyboard shortcuts

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