Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BudgetGoal ¶ added in v0.0.8
type BudgetGoal struct { Name string `firestore:"name,omitempty"` Description string `firestore:"description,omitempty"` Target float32 `firestore:"target,omitempty"` Current float32 `firestore:"current,omitempty"` LastUpdated int64 `firestore:"last_updated,omitempty"` }
BudgetGoal for Firestore serialization/deserialization.
func (*BudgetGoal) SetValue ¶ added in v0.0.8
func (g *BudgetGoal) SetValue(value float32)
SetValue sets the current value of the budget goal, as well as the last updated timestamp.
type Goal ¶
type Goal struct { Name string `firestore:"name,omitempty"` Stage string `firestore:"stage,omitempty"` Start int64 `firestore:"start,omitempty"` End int64 `firestore:"end,omitempty"` Target float32 `firestore:"target,omitempty"` Unit string `firestore:"unit,omitempty"` Trajectory Trajectory `firestore:"trajectory,omitempty"` }
Goal for Firestore serialization/deserialization.
func (*Goal) IncrementValue ¶
IncrementValue adds a delta to the latest value on the trajectory of a goal, using the current timestamp.
type Objective ¶
type Objective struct { Name string `firestore:"name,omitempty"` Description string `firestore:"description,omitempty"` Goals map[string]Goal `firestore:"goals,omitempty"` BudgetGoals map[string]BudgetGoal `firestore:"budget_goals,omitempty"` }
Objective for Firestore serialization/deserialization.
func (*Objective) IncrementGoalValue ¶
IncrementGoalValue adds a new value to the trajectory of the goal, using the current timestamp.
func (*Objective) SetBudgetGoalValue ¶ added in v0.0.8
SetBudgetGoalValue sets the current value on a budget goal.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage provides an interface to serialization/deserialization of objectives in Firestore.
func NewStorage ¶
NewStorage creates client for a particular project.
func (Storage) IncrementGoalValue ¶
IncrementGoalValue adds a new value to the trajectory of the goal, using the current timestamp.
func (Storage) SetBudgetGoalValue ¶ added in v0.0.8
SetBudgetGoalValue sets the current value of the budget goal.
type Trajectory ¶
type Trajectory []DateValue
Trajectory for Firestore serialization/deserialization.
func (*Trajectory) IncrementValue ¶ added in v0.0.2
func (t *Trajectory) IncrementValue(delta float32)
IncrementValue adds a delta to the latest value on the trajectory, using the current timestamp.
func (*Trajectory) SetValue ¶ added in v0.0.2
func (t *Trajectory) SetValue(value float32)
SetValue adds a new value to the trajectory, using the current timestamp.