api

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 15 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)

func (*Client) UpdateTimeEntry added in v0.18.0

func (c *Client) UpdateTimeEntry(workspaceId int, entryId int, entry data.TimeEntry) (*data.TimeEntryItem, error)

type ProjectService added in v0.12.0

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

type SevenPaceClient added in v0.19.0

type SevenPaceClient struct {
	BaseURL        string
	HTTPClient     *http.Client
	Domain         string
	Username       string
	Password       string
	ActivityTypeID string
}

SevenPaceClient talks to an on-prem 7pace Timetracker REST API using NTLM (Windows/Negotiate) authentication.

func NewSevenPaceClient added in v0.19.0

func NewSevenPaceClient(cfg utils.SevenPaceConfig) *SevenPaceClient

NewSevenPaceClient builds a client from the given 7pace configuration. The HTTP transport is wrapped with an NTLM negotiator so that Basic-auth credentials set on each request are used to perform the NTLM handshake.

func (*SevenPaceClient) CreateWorkLog added in v0.19.0

func (c *SevenPaceClient) CreateWorkLog(workLog data.SevenPaceWorkLog) (*data.SevenPaceWorkLog, error)

CreateWorkLog posts a single worklog to 7pace Timetracker.

Jump to

Keyboard shortcuts

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