timely

package
v0.0.0-...-c05b6d7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LocalCallback = "urn:ietf:wg:oauth:2.0:oob"

LocalCallback is the OAuth2 callback URL for local applications

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

type Client

type Client struct {
	// Configuration
	ApiURL        string
	ApplicationID string
	ClientSecret  string
	CallbackURL   string
	AccountID     int
	ProjectID     int
	DebugMode     bool // Will occasionally get used for debugging

	// State
	HttpClient *client.HttpClient
	// contains filtered or unexported fields
}

func (*Client) DeleteEvents

func (c *Client) DeleteEvents(events []*timelyGetEvent) (wait bool, err error)

func (*Client) Export

func (c *Client) Export(events []*event.Event) error

func (*Client) GetAllLabels

func (c *Client) GetAllLabels() (err error)

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (User, error)

func (*Client) GetProjectByID

func (c *Client) GetProjectByID(id int) (Project, bool)

func (*Client) GetProjectLabels

func (c *Client) GetProjectLabels() (labels []Label, err error)

func (*Client) GetProjects

func (c *Client) GetProjects() error

func (*Client) GetRequest

func (c *Client) GetRequest(version, endpoint string, params map[string]string) (*client.Resp, error)

func (*Client) Init

func (c *Client) Init(ctx context.Context) error

func (*Client) ListAccounts

func (c *Client) ListAccounts() (accounts []Account, err error)

func (*Client) ListAllEvents

func (c *Client) ListAllEvents(date string) ([]timelyGetEvent, error)

ListAllEvents retrieves all events for the specified date (YYYY-MM-DD), across all projects.

func (*Client) ListAllEventsForProject

func (c *Client) ListAllEventsForProject(date string) ([]timelyGetEvent, error)

ListAllEventsForProject retrieves all events for the specified date (YYYY-MM-DD), filtered by the client's ProjectID.

func (*Client) ListProjects

func (c *Client) ListProjects() (string, error)

func (*Client) ListRootLabels

func (c *Client) ListRootLabels() (string, error)

func (*Client) PostEventBatch

func (c *Client) PostEventBatch(batch []*timelyPostEvent) error

func (*Client) PostRequest

func (c *Client) PostRequest(version, endpoint string, body []byte) (*client.Resp, error)

func (*Client) SelectAccount

func (c *Client) SelectAccount() error

type Label

type Label struct {
	ID       int     `json:"id"`
	Name     string  `json:"name"`
	Sequence int     `json:"sequence"`
	ParentID *int    `json:"parent_id,omitempty"`
	Active   bool    `json:"active"`
	Children []Label `json:"children,omitempty"`
}

type Project

type Project struct {
	ID            int            `json:"id"`
	Active        bool           `json:"active"`
	Name          string         `json:"name"`
	Labels        []ProjectLabel `json:"labels,omitempty"`
	RequiredNotes bool           `json:"required_notes"`
}

type ProjectLabel

type ProjectLabel struct {
	ProjectID int `json:"project_id"`
	LabelID   int `json:"label_id"`
}

type User

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

Jump to

Keyboard shortcuts

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