habitrpg

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	// General
	ID          string        `json:"id,omitempty"`
	Type        string        `json:"type,omitempty"`
	DateCreated time.Time     `json:"dateCreated,omitempty"`
	Text        string        `json:"text,omitempty"`
	Notes       string        `json:"notes,omitempty"`
	Tags        []string      `json:"tags,omitempty"`
	Value       float64       `json:"value,omitempty"`
	Priority    int           `json:"priority,omitempty"`
	Attribute   string        `json:"attribute,omitempty"`
	Challenge   TaskChallenge `json:"challenge,omitempty"`

	// Multiple types
	History           []TaskHistory        `json:"history,omitempty"`
	Completed         bool                 `json:"completed,omitempty"`
	CollapseChecklist bool                 `json:"collapseChecklist,omitempty"`
	Checklist         []TaskChecklistEntry `json:"checklist,omitempty"`

	// Habit
	Up   bool `json:"up,omitempty"`
	Down bool `json:"down,omitempty"`

	// Daily
	Repeat TaskRepeat `json:"repeat,omitempty"`
	Streak int        `json:"streak,omitempty"`

	// Todo
	DateCompleted time.Time `json:"dateCompleted,omitempty"`
	Date          string    `json:"date,omitempty"`
}

type TaskChallenge

type TaskChallenge struct {
	ID     string `json:"id,omitempty"`
	Broken string `json:"broken,omitempty"`
	Winner string `json:"winner,omitempty"`
}

type TaskChecklistEntry

type TaskChecklistEntry struct {
	Completed bool   `json:"completed,omitempty"`
	Text      string `json:"text,omitempty"`
	ID        string `json:"id,omitempty"`
}

type TaskHistory

type TaskHistory struct {
	Date  TaskHistoryDate `json:"date,omitempty"` // WTF: Though docs says this is a Date, there is an timestamp in it
	Value float64         `json:"value,omitempty"`
}

type TaskHistoryDate

type TaskHistoryDate time.Time

func (TaskHistoryDate) MarshalJSON

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

func (TaskHistoryDate) String

func (t TaskHistoryDate) String() string

func (*TaskHistoryDate) UnmarshalJSON

func (t *TaskHistoryDate) UnmarshalJSON(in []byte) error

type TaskRepeat

type TaskRepeat struct {
	Monday    bool `json:"m,omitempty"`
	Tuesday   bool `json:"t,omitempty"`
	Wednesday bool `json:"w,omitempty"`
	Thursday  bool `json:"th,omitempty"`
	Friday    bool `json:"f,omitempty"`
	Saturday  bool `json:"s,omitempty"`
	Sunday    bool `json:"su,omitempty"`
}

Jump to

Keyboard shortcuts

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