Documentation ¶
Index ¶
- Variables
- func GenerateDummyRawItem() map[string]interface{}
- func GenerateDummyRawItems(size int) map[string]map[string]interface{}
- func GetId(data map[string]interface{}) int
- func IsPending(status string) bool
- type Item
- func (item *Item) GetCreationDateTime() time.Time
- func (item *Item) GetDueDate() *time.Time
- func (item *Item) GetId() int
- func (item *Item) GetStatus() string
- func (item *Item) GetTags() []string
- func (item *Item) GetTitle() string
- func (item *Item) GetType() string
- func (item *Item) HasAnyTag(tags ...string) bool
- func (item *Item) HasStar() bool
- func (item *Item) HasTag(tag string) bool
- func (item *Item) Star()
- func (item *Item) Unstar()
- type ItemCollection
- func (c ItemCollection) Exclude(predicate ItemPredicate) ItemCollection
- func (c ItemCollection) Filter(predicate ItemPredicate) ItemCollection
- func (c ItemCollection) FilterByCreationDate(fromDate, toDate *time.Time) ItemCollection
- func (c ItemCollection) FilterByStatus(status string) ItemCollection
- func (c ItemCollection) FilterByTag(tag string) ItemCollection
- func (c ItemCollection) FilterByTags(tags ...string) ItemCollection
- func (c ItemCollection) FilterByType(kind string) ItemCollection
- func (c ItemCollection) FilterPending() ItemCollection
- func (c ItemCollection) Len() int
- func (c ItemCollection) Less(i, j int) bool
- func (c ItemCollection) Swap(i, j int)
- type ItemFactory
- type ItemPredicate
- type Manageable
- type Note
- type NoteFactory
- type Priority
- type Task
- type TaskFactory
- type TaskLog
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var DummyItemFactory = factory.NewFactory( &Item{}, ).SeqInt("Id", func(n int) (interface{}, error) { return n, nil }).Attr("Type", func(args factory.Args) (interface{}, error) { return "note", nil }).Attr("Title", func(args factory.Args) (interface{}, error) { return "note", nil }).Attr("Description", func(args factory.Args) (interface{}, error) { return "my description", nil }).Attr("IsStarred", func(args factory.Args) (interface{}, error) { return randomdata.Boolean(), nil }).Attr("Tags", func(args factory.Args) (interface{}, error) { len := randomdata.Number(0, 5) var tags = make([]string, len) for i := 0; i < len; i++ { tags[i] = randomdata.SillyName() } return tags, nil })
Functions ¶
func GenerateDummyRawItem ¶
func GenerateDummyRawItem() map[string]interface{}
func GenerateDummyRawItems ¶
Types ¶
type Item ¶
type Item struct { Id int `json:"id"` Title string `json:"title"` Description string `json:"description"` CreatedAt time.Time `json:"created_at"` IsStarred bool `json:"is_starred"` Tags []string `json:"tags"` Type string `json:"type"` }
func (*Item) GetCreationDateTime ¶
func (*Item) GetDueDate ¶ added in v0.0.2
type ItemCollection ¶
type ItemCollection []Manageable
func (ItemCollection) Exclude ¶ added in v0.0.2
func (c ItemCollection) Exclude(predicate ItemPredicate) ItemCollection
func (ItemCollection) Filter ¶ added in v0.0.2
func (c ItemCollection) Filter(predicate ItemPredicate) ItemCollection
func (ItemCollection) FilterByCreationDate ¶ added in v0.0.2
func (c ItemCollection) FilterByCreationDate(fromDate, toDate *time.Time) ItemCollection
func (ItemCollection) FilterByStatus ¶ added in v0.0.2
func (c ItemCollection) FilterByStatus(status string) ItemCollection
func (ItemCollection) FilterByTag ¶ added in v0.0.2
func (c ItemCollection) FilterByTag(tag string) ItemCollection
func (ItemCollection) FilterByTags ¶ added in v0.0.2
func (c ItemCollection) FilterByTags(tags ...string) ItemCollection
func (ItemCollection) FilterByType ¶ added in v0.0.2
func (c ItemCollection) FilterByType(kind string) ItemCollection
func (ItemCollection) FilterPending ¶ added in v0.0.2
func (c ItemCollection) FilterPending() ItemCollection
func (ItemCollection) Less ¶
func (c ItemCollection) Less(i, j int) bool
func (ItemCollection) Swap ¶
func (c ItemCollection) Swap(i, j int)
type ItemFactory ¶
type ItemFactory interface {
Create(data map[string]interface{}) Manageable
}
type ItemPredicate ¶ added in v0.0.2
type ItemPredicate func(item Manageable) bool
type Manageable ¶
type Manageable interface { GetId() int GetTitle() string GetTags() []string GetType() string GetStatus() string GetCreationDateTime() time.Time HasStar() bool Star() Unstar() GetDueDate() *time.Time HasTag(tag string) bool HasAnyTag(tags ...string) bool }
func CreateItem ¶
func CreateItem(item map[string]interface{}) Manageable
type NoteFactory ¶
type NoteFactory struct{}
func (*NoteFactory) Create ¶
func (factory *NoteFactory) Create(data map[string]interface{}) Manageable
type Task ¶
type Task struct { Item Status TaskStatus `json:"status"` Priority Priority `json:"priority"` DueDate time.Time `json:"due_date"` CompletedPercentage uint `json:"completed_percentage"` DurationInMinutes uint `json:"duration_in_minutes"` StartedAt time.Time `json:"started_at"` CompletedAt time.Time `json:"completed_at"` CancelledAt time.Time `json:"cancelled_at"` Logs []TaskLog `json:"logs"` // contains filtered or unexported fields }
func NewTask ¶
func NewTask(title string, description string, status TaskStatus, tags ...string) *Task
func (*Task) GetDueDate ¶ added in v0.0.2
func (*Task) TriggerEvent ¶
type TaskFactory ¶
type TaskFactory struct{}
func (*TaskFactory) Create ¶
func (factory *TaskFactory) Create(data map[string]interface{}) Manageable
type TaskStatus ¶
type TaskStatus string
const ( ToDo TaskStatus = "todo" InProgress TaskStatus = "in-progress" Stopped TaskStatus = "stopped" Completed TaskStatus = "completed" Cancelled TaskStatus = "cancelled" )
Click to show internal directories.
Click to hide internal directories.