schema

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TagIll        = "ill"
	TagVacation   = "vacation"
	TagWeekend    = "weekend"
	TagHoliday    = "holiday"
	TagEvent      = "event"
	TagHomeoffice = "homeoffice"
	TagBreak      = "break"
	TagAutotrack  = "autotrack"
	TagOnCall     = "on-call"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

type Day struct {
	DayID    string `json:"_id"`
	Revision string `json:"_rev,omitempty"`

	Times []*Time  `json:"times"`
	Tags  []string `json:"tags,omitempty"`

	// deprecated tags, have auto-migration
	IsIll      bool `json:"is_ill,omitempty"`
	IsVacation bool `json:"is_vacation,omitempty"`
	IsWeekend  bool `json:"is_weekend,omitempty"`
	IsHoliday  bool `json:"is_holiday,omitempty"`
	IsEvent    bool `json:"is_event,omitempty"`
	Homeoffice bool `json:"homeoffice,omitempty"`
	// contains filtered or unexported fields
}

func LoadDay

func LoadDay(db *couch.Client, date time.Time, mayCreate bool) (*Day, error)

func (*Day) Save

func (d *Day) Save(db *couch.Client) error

func (*Day) Tag

func (d *Day) Tag(tag string)

type Overtime

type Overtime struct {
	Value float64 `json:"value"`
}

func GetOvertime

func GetOvertime(db *couch.Client, day time.Time) (Overtime, error)

type Time

type Time struct {
	ID    string `json:"id"`
	Start string `json:"start"`
	End   string `json:"end"`

	Tags []string `json:"tags,omitempty"`

	// deprecated tags, have auto-migration
	IsBreak     bool `json:"is_break,omitempty"`
	IsAutotrack bool `json:"is_autotrack,omitempty"`
	IsOnCall    bool `json:"is_on_call,omitempty"`
}

func (*Time) Tag

func (w *Time) Tag(tag string)

Jump to

Keyboard shortcuts

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