pursuit

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

README

This is not an officially supported Google product.

Overview

A web application that permits users to plan, track, view and thus help the users achieve their personal objectives and goals.

Implementation

  • The web application can be deployed using Firebase.
  • User data, i.e. the objectives and goals are stored in Firestore.
  • There is currently no end-to-end encryption for user data.
  • Users need to log in to their Google account before using the web application.
  • The data is currently not encrypted in Firestore.

Important notes

  • Source code may change without retaining backward compatibility.

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 DateValue

type DateValue struct {
	Date  int64   `firestore:"date"`
	Value float32 `firestore:"value"`
}

DateValue for Firestore serialization/deserialization.

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

func (g *Goal) IncrementValue(delta float32)

IncrementValue adds a delta to the latest value on the trajectory of a goal, using the current timestamp.

func (*Goal) SetValue

func (g *Goal) SetValue(value float32)

SetValue adds a new value to the trajectory of the 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

func (o *Objective) IncrementGoalValue(goalID string, delta float32) error

IncrementGoalValue adds a new value to the trajectory of the goal, using the current timestamp.

func (*Objective) SetBudgetGoalValue added in v0.0.8

func (o *Objective) SetBudgetGoalValue(goalID string, value float32) error

SetBudgetGoalValue sets the current value on a budget goal.

func (*Objective) SetGoalValue

func (o *Objective) SetGoalValue(goalID string, value float32) error

SetGoalValue adds a new value to the trajectory of the goal, using the current timestamp.

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage provides an interface to serialization/deserialization of objectives in Firestore.

func NewStorage

func NewStorage(projectID string) *Storage

NewStorage creates client for a particular project.

func (Storage) IncrementGoalValue

func (s Storage) IncrementGoalValue(userID, objectiveID, goalID string, delta float32) error

IncrementGoalValue adds a new value to the trajectory of the goal, using the current timestamp.

func (Storage) SetBudgetGoalValue added in v0.0.8

func (s Storage) SetBudgetGoalValue(userID, objectiveID, goalID string, value float32) error

SetBudgetGoalValue sets the current value of the budget goal.

func (Storage) SetGoalValue

func (s Storage) SetGoalValue(userID, objectiveID, goalID string, value float32) error

SetGoalValue adds a new value to the trajectory of the goal, using the current timestamp.

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.

Jump to

Keyboard shortcuts

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