model

package
v0.0.0-...-cb22eb2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2016 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DATE_FORMAT        = "2006-01-02"
	DATE_STRING_FORMAT = "02 Jan 2006"
)

Variables

This section is empty.

Functions

func NewEvent

func NewEvent(clock Clock, author, title string, standup Standup) interface{}

func NewFace

func NewFace(clock Clock, author, title string, standup Standup) interface{}

func NewHelp

func NewHelp(clock Clock, author, title string, standup Standup) interface{}

func NewInteresting

func NewInteresting(clock Clock, author, title string, standup Standup) interface{}

Types

type Clock

type Clock interface {
	Now() time.Time
}

type Entry

type Entry struct {
	Date      string `json:"date"`
	Title     string `json:"title"`
	Body      string `json:"description"`
	Author    string `json:"author"`
	Id        string `json:"-"`
	StandupId int    `json:"-"`
	ItemKind  string `json:"-"`
}

func NewEntry

func NewEntry(clock Clock, author, title string, standup Standup, itemKind string) *Entry

func (Entry) GetDateString

func (entry Entry) GetDateString() string

func (Entry) GetEntry

func (entry Entry) GetEntry() *Entry

func (Entry) MakeCreateRequest

func (entry Entry) MakeCreateRequest() WhiteboardRequest

func (Entry) MakeUpdateRequest

func (entry Entry) MakeUpdateRequest() WhiteboardRequest

func (Entry) String

func (entry Entry) String() string

func (Entry) Validate

func (entry Entry) Validate() bool

type EntryType

type EntryType interface {
	Validate() bool
	MakeCreateRequest() WhiteboardRequest
	MakeUpdateRequest() WhiteboardRequest
	String() string
	GetEntry() *Entry
	GetDateString() string
}

type Event

type Event struct{ *Entry }

func (Event) GetEntry

func (event Event) GetEntry() *Entry

type Face

type Face struct{ *Entry }

func (Face) GetEntry

func (face Face) GetEntry() *Entry

func (Face) MakeCreateRequest

func (face Face) MakeCreateRequest() (request WhiteboardRequest)

func (Face) MakeUpdateRequest

func (face Face) MakeUpdateRequest() (request WhiteboardRequest)

type Help

type Help struct{ *Entry }

func (Help) GetEntry

func (help Help) GetEntry() *Entry

type Interesting

type Interesting struct{ *Entry }

func (Interesting) GetEntry

func (interesting Interesting) GetEntry() *Entry

type Item

type Item struct {
	StandupId   int    `json:"standup_id"`
	Title       string `json:"title"`
	Date        string `json:"date"`
	PostId      string `json:"post_id"`
	Public      string `json:"public"`
	Kind        string `json:"kind"`
	Description string `json:"description,omitempty"`
	Author      string `json:"author,omitempty"`
}

type RealClock

type RealClock struct{}

func (RealClock) Now

func (clock RealClock) Now() time.Time

type Standup

type Standup struct {
	Id       int    `json:"id"`
	TimeZone string `json:"time_zone_name_iana"`
	Title    string `json:"title"`
}

type StandupItems

type StandupItems struct {
	Helps        []Entry `json:"Help"`
	Interestings []Entry `json:"Interesting"`
	Faces        []Entry `json:"New face"`
	Events       []Entry `json:"Event"`
}

func (StandupItems) Empty

func (items StandupItems) Empty() bool

func (StandupItems) EventsString

func (items StandupItems) EventsString() string

func (StandupItems) FacesString

func (items StandupItems) FacesString() string

func (StandupItems) HelpsString

func (items StandupItems) HelpsString() string

func (StandupItems) InterestingsString

func (items StandupItems) InterestingsString() string

func (StandupItems) String

func (items StandupItems) String() string

type WhiteboardRequest

type WhiteboardRequest struct {
	Utf8   string `json:"utf8"`
	Method string `json:"_method,omitempty"`
	Token  string `json:"authenticity_token"`
	Item   Item   `json:"item"`
	Commit string `json:"commit,omitempty"`
	Id     string `json:"id,omitempty"`
}

Jump to

Keyboard shortcuts

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