goal

package
v1.107.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderToday added in v1.64.1

func RenderToday(goal *Goal, out output.Output) (string, error)

RenderToday generates a text representation from goal of the current day. If out is set to output.RawJSONOutput or output.JSONOutput, the goal will be marshaled to JSON. Expects exactly one summary for the current day. Will return an error otherwise.

Types

type ChartData added in v1.64.1

type ChartData struct {
	ActualSeconds          float64 `json:"actual_seconds"`
	ActualSecondsText      string  `json:"actual_seconds_text"`
	GoalSeconds            int     `json:"goal_seconds"`
	GoalSecondsText        string  `json:"goal_seconds_text"`
	Range                  Range   `json:"range"`
	RangeStatus            string  `json:"range_status"`
	RangeStatusReason      string  `json:"range_status_reason"`
	RangeStatusReasonShort string  `json:"range_status_reason_short"`
}

ChartData represents the chart data of a goal.

type Data added in v1.64.1

type Data struct {
	AverageStatus           string       `json:"average_status"`
	ChartData               []ChartData  `json:"chart_data"`
	CreatedAt               string       `json:"created_at"`
	CumulativeStatus        string       `json:"cumulative_status"`
	CustomTitle             *string      `json:"custom_title"`
	Delta                   string       `json:"delta"`
	Editors                 []string     `json:"editors"`
	ID                      string       `json:"id"`
	IgnoreDays              []string     `json:"ignore_days"`
	IgnoreZeroDays          bool         `json:"ignore_zero_days"`
	ImproveByPercent        *float64     `json:"improve_by_percent"`
	IsCurrentUserOwner      bool         `json:"is_current_user_owner"`
	IsEnabled               bool         `json:"is_enabled"`
	IsInverse               bool         `json:"is_inverse"`
	IsSnoozed               bool         `json:"is_snoozed"`
	IsTweeting              bool         `json:"is_tweeting"`
	Languages               []string     `json:"languages"`
	ModifiedAt              *string      `json:"modified_at"`
	Owner                   Owner        `json:"owner"`
	Projects                []string     `json:"projects"`
	RangeText               string       `json:"range_text"`
	Seconds                 int          `json:"seconds"`
	SharedWith              []string     `json:"shared_with"`
	SnoozeUntil             *string      `json:"snooze_until"`
	Status                  string       `json:"status"`
	StatusPercentCalculated int          `json:"status_percent_calculated"`
	Subscribers             []Subscriber `json:"subscribers"`
	Title                   string       `json:"title"`
	Type                    string       `json:"type"`
}

Data represents the data of a goal.

type Goal

type Goal struct {
	CachedAt string `json:"cached_at"`
	Data     Data   `json:"data"`
}

Goal represents a goal.

type Owner added in v1.64.1

type Owner struct {
	DisplayName string  `json:"display_name"`
	Email       *string `json:"email"`
	FullName    string  `json:"full_name"`
	ID          string  `json:"id"`
	Photo       string  `json:"photo"`
	Username    string  `json:"username"`
}

Owner represents the owner of a goal.

type Range added in v1.64.1

type Range struct {
	Date     string `json:"date"`
	End      string `json:"end"`
	Start    string `json:"start"`
	Text     string `json:"text"`
	Timezone string `json:"timezone"`
}

Range represents the time range of a goal.

type Subscriber added in v1.64.1

type Subscriber struct {
	DisplayName    string  `json:"display_name"`
	Email          *string `json:"email"`
	EmailFrequency string  `json:"email_frequency"`
	FullName       string  `json:"full_name"`
	UserID         string  `json:"user_id"`
	Username       string  `json:"username"`
}

Subscriber represents a subscriber of a goal.

Jump to

Keyboard shortcuts

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