model

package
v0.0.0-...-013d6bb Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TodaysEvents     = "today"
	TomorrowsEvents  = "tomorrow"
	NextBizDayEvents = "nextBizDayEvents"
)

Variables

View Source
var (
	Clock clock = RealClock{}
)
View Source
var Hash = hash

Functions

This section is empty.

Types

type Event

type Event struct {
	Id    string `json:"id,omitempty"`
	Title string `json:"title,omitempty"`
	Day   string `json:"day,omitempty"`
	Hour  int    `json:"hour,omitempty"`
	Min   int    `json:"min,omitempty"`
	AmPm  string `json:"am-pm,omitempty"`
}

func (Event) ToString

func (event Event) ToString() string

type Events

type Events map[string][]Event

func (Events) AddEvent

func (events Events) AddEvent(newEvent *Event) Events

func (Events) ConvertFromDates

func (events Events) ConvertFromDates() Events

func (Events) ConvertToDate

func (events Events) ConvertToDate() Events

func (Events) IsEmpty

func (events Events) IsEmpty() bool

func (Events) RemoveEvent

func (events Events) RemoveEvent(id string) Events

type Goal

type Goal struct {
	Id    string `json:"id,omitempty"`
	Value string `json:"value,omitempty"`
}

type Goals

type Goals map[string][]Goal

func (Goals) AddGoal

func (goals Goals) AddGoal(category string, newGoal string) Goals

func (Goals) RemoveGoal

func (goals Goals) RemoveGoal(id string) Goals

type Metadata

type Metadata struct {
	ChannelId   string `json:"channel_id,omitempty"`
	ResponseUrl string `json:"response_url,omitempty"`
}

func (*Metadata) ConvertMetadataToJson

func (modelToConvert *Metadata) ConvertMetadataToJson() string

type Model

type Model struct {
	Index  int    `json:"index"`
	Events Events `json:"events"`
	Goals  Goals  `json:"goals"`
}

func (*Model) ConvertFromDbModel

func (modelToConvert *Model) ConvertFromDbModel() *Model

func (*Model) ConvertModelToJson

func (modelToConvert *Model) ConvertModelToJson() string

func (*Model) ConvertToDbModel

func (modelToConvert *Model) ConvertToDbModel() *Model

type RealClock

type RealClock struct{}

func (RealClock) Now

func (RealClock) Now() time.Time

type TimeApi

type TimeApi struct {
	Today      string
	NextBizDay string
	IsFriday   bool
}

func Days

func Days() TimeApi

Jump to

Keyboard shortcuts

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