gttimeentry

package
v0.0.0-...-7924af4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Endpoint = "/time_entries"
View Source
const EndpointCurrent = Endpoint + "/current"
View Source
const EndpointStart = Endpoint + "/start"

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeEntries

type TimeEntries []TimeEntry

type TimeEntry

type TimeEntry struct {
	Id          uint64                 `json:"id,omitempty"`
	Description string                 `json:"description"`
	Project     *gtproject.Project     `json:"project"`
	Start       time.Time              `json:"start"`
	Stop        time.Time              `json:"stop"`
	Duration    int64                  `json:"duration"`
	Billable    bool                   `json:"billable"`
	Workspace   *gtworkspace.Workspace `json:"workspace"`
	Tags        []string               `json:"tags"`
	Pid         uint64                 `json:"pid"`
	Wid         uint64                 `json:"wid"`
	Tid         uint64                 `json:"tid"`
	CreatedWith string                 `json:"created_with,omitempty" `
}

type TimeEntryClient

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

func NewClient

func NewClient(thc *gthttp.TogglHttpClient) *TimeEntryClient

Return a UserClient. An error is also returned when some configuration option is invalid

thc,err := gtoggl.NewClient("token")
uc,err := guser.NewClient(thc)

func (*TimeEntryClient) Create

func (c *TimeEntryClient) Create(t *TimeEntry) (*TimeEntry, error)

func (*TimeEntryClient) Current

func (c *TimeEntryClient) Current() (*TimeEntry, error)

func (*TimeEntryClient) Delete

func (tc *TimeEntryClient) Delete(id uint64) error

func (*TimeEntryClient) Get

func (c *TimeEntryClient) Get(tid uint64) (*TimeEntry, error)

func (*TimeEntryClient) GetRange

func (c *TimeEntryClient) GetRange(start time.Time, end time.Time) (TimeEntries, error)

func (*TimeEntryClient) List

func (c *TimeEntryClient) List() (TimeEntries, error)

func (*TimeEntryClient) Start

func (c *TimeEntryClient) Start(t *TimeEntry) (*TimeEntry, error)

func (*TimeEntryClient) Stop

func (c *TimeEntryClient) Stop(t *TimeEntry) (*TimeEntry, error)

func (*TimeEntryClient) Update

func (c *TimeEntryClient) Update(t *TimeEntry) (*TimeEntry, error)

Jump to

Keyboard shortcuts

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