clockify

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListAll

func ListAll[T any](ctx context.Context, c *Client, path string, baseQuery map[string]string) ([]T, error)

Types

type APIError

type APIError struct {
	Method     string
	Path       string
	StatusCode int
	Status     string
	Body       string
	RetryAfter time.Duration
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

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

func NewClient

func NewClient(apiKey, baseURL string, timeout time.Duration, maxRetries int) *Client

func (*Client) Close

func (c *Client) Close()

Close releases idle connections held by the client.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, query map[string]string, out any) error

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, body any, out any) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, body any, out any) error

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, body any, out any) error

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(ua string)

SetUserAgent sets the User-Agent string sent with every request.

type ClientEntity

type ClientEntity struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Project

type Project struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	ClientID string `json:"clientId"`
	Color    string `json:"color"`
	Archived bool   `json:"archived"`
}

type Tag

type Tag struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Task

type Task struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	ProjectID string `json:"projectId"`
}

type TimeEntry

type TimeEntry struct {
	ID           string       `json:"id"`
	Description  string       `json:"description"`
	ProjectID    string       `json:"projectId"`
	ProjectName  string       `json:"projectName,omitempty"`
	TaskID       string       `json:"taskId,omitempty"`
	TagIDs       []string     `json:"tagIds,omitempty"`
	Billable     bool         `json:"billable,omitempty"`
	UserID       string       `json:"userId,omitempty"`
	WorkspaceID  string       `json:"workspaceId,omitempty"`
	TimeInterval TimeInterval `json:"timeInterval"`
}

func (TimeEntry) DurationSeconds

func (e TimeEntry) DurationSeconds() int64

func (TimeEntry) EndTime

func (e TimeEntry) EndTime() (time.Time, error)

func (TimeEntry) IsRunning

func (e TimeEntry) IsRunning() bool

func (TimeEntry) StartTime

func (e TimeEntry) StartTime() (time.Time, error)

type TimeInterval

type TimeInterval struct {
	Start    string `json:"start"`
	End      string `json:"end,omitempty"`
	Duration string `json:"duration,omitempty"`
}

type User

type User struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type Workspace

type Workspace struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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