api

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(seconds float64) string

Types

type Client added in v0.4.0

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
	AuthToken  string
	Cache      *cache.CacheService
}

func NewAPIClient

func NewAPIClient(authToken string) *Client

func (*Client) CreateTimeEntry added in v0.4.0

func (c *Client) CreateTimeEntry(workspaceId int, entry data.TimeEntry) (*data.TimeEntry, error)

func (*Client) GetCurrentTimerEntry added in v0.4.0

func (c *Client) GetCurrentTimerEntry() (*data.TimeEntryItem, error)

func (*Client) GetHistory added in v0.4.0

func (c *Client) GetHistory(from, to *time.Time) ([]data.TimeEntryItem, error)

func (*Client) GetProjectIdByName added in v0.4.0

func (c *Client) GetProjectIdByName(workspaceId int, projectName string) (int, error)

func (*Client) GetProjects added in v0.4.0

func (c *Client) GetProjects(workspaceId int) ([]data.Project, error)

func (*Client) GetProjectsLookupMap added in v0.4.0

func (c *Client) GetProjectsLookupMap(workspaceId int) (map[int]string, error)

func (*Client) GetWorkspaces added in v0.4.0

func (c *Client) GetWorkspaces() ([]data.Workspace, error)

func (*Client) NewTimeEntry added in v0.7.0

func (c *Client) NewTimeEntry(description string,
	workspaceID int,
	projectID int,
	billable bool,
) data.TimeEntry

func (*Client) StopTimeEntry added in v0.4.0

func (c *Client) StopTimeEntry(workspaceId int, entryId int) (*data.TimeEntryItem, error)

type ProjectService added in v0.12.0

type ProjectService interface {
	GetProjects(workspaceId int) ([]data.Project, error)
}

Jump to

Keyboard shortcuts

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