Documentation
¶
Overview ¶
Package togglapi provides repsitorties for accessing Toggl objects such as Workspaces, Projects and Time Entries via the Toggl REST API.
Package togglapi provides repsitorties for accessing Toggl objects such as Workspaces, Projects and Time Entries via the Toggl REST API.
Package togglapi provides repsitorties for accessing Toggl objects such as Workspaces, Projects and Time Entries via the Toggl REST API.
Index ¶
- func NewAPI(baseURL, token string) model.TogglAPI
- func NewClientRepository(baseURL, token string) model.ClientRepository
- func NewProjectRepository(baseURL, token string) model.ProjectRepository
- func NewTimeEntryRepository(baseURL, token string) model.TimeEntryRepository
- func NewWorkspaceRepository(baseURL, token string) model.WorkspaceRepository
- type API
- type RESTClientRepository
- type RESTProjectRepository
- type RESTRequester
- type RESTTimeEntryRepository
- type RESTWorkspaceRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientRepository ¶
func NewClientRepository(baseURL, token string) model.ClientRepository
NewClientRepository create a new client for the Toggl client API.
func NewProjectRepository ¶
func NewProjectRepository(baseURL, token string) model.ProjectRepository
NewProjectRepository create a new client for the Toggl project API.
func NewTimeEntryRepository ¶
func NewTimeEntryRepository(baseURL, token string) model.TimeEntryRepository
NewTimeEntryRepository create a new client for the Toggl time entry API.
func NewWorkspaceRepository ¶
func NewWorkspaceRepository(baseURL, token string) model.WorkspaceRepository
NewWorkspaceRepository create a new client for the Toggl workspace API.
Types ¶
type API ¶
type API struct {
model.WorkspaceRepository
model.ProjectRepository
model.TimeEntryRepository
model.ClientRepository
}
API provides functions for interacting with the Toggl API.
type RESTClientRepository ¶
type RESTClientRepository struct {
// contains filtered or unexported fields
}
RESTClientRepository provides functions for interacting with Toggls' client API.
func (*RESTClientRepository) CreateClient ¶
CreateClient creates a new client.
func (*RESTClientRepository) GetClients ¶
func (repository *RESTClientRepository) GetClients() ([]model.Client, error)
GetClients returns all clients for the given workspace.
type RESTProjectRepository ¶
type RESTProjectRepository struct {
// contains filtered or unexported fields
}
RESTProjectRepository provides functions for interacting with Toggls' project API.
func (*RESTProjectRepository) CreateProject ¶
func (repository *RESTProjectRepository) CreateProject(project model.Project) (model.Project, error)
CreateProject creates a new project.
func (*RESTProjectRepository) GetProjects ¶
func (repository *RESTProjectRepository) GetProjects(workspaceID int) ([]model.Project, error)
GetProjects returns all projects for the given workspace.
type RESTRequester ¶
type RESTRequester interface {
// Request sends an HTTP request with the given parameters (method, route, payload)
// to an REST API and returns the APIs' response or an error if the request failed.
Request(method, route string, payload io.Reader) ([]byte, error)
}
The RESTRequester interface provides a function for sending HTTP requests to REST APIs.
type RESTTimeEntryRepository ¶
type RESTTimeEntryRepository struct {
// contains filtered or unexported fields
}
RESTTimeEntryRepository provides functions for interacting with Toggls' time entry API.
func (*RESTTimeEntryRepository) CreateTimeEntry ¶
func (repository *RESTTimeEntryRepository) CreateTimeEntry(timeEntry model.TimeEntry) (model.TimeEntry, error)
CreateTimeEntry creates a new time entry.
func (*RESTTimeEntryRepository) GetTimeEntries ¶
func (repository *RESTTimeEntryRepository) GetTimeEntries(start, end time.Time) ([]model.TimeEntry, error)
GetTimeEntries returns all time entries created between the given start and end date. Returns nil and an error if the time entries could not be retrieved.
type RESTWorkspaceRepository ¶
type RESTWorkspaceRepository struct {
// contains filtered or unexported fields
}
RESTWorkspaceRepository provides functions for interacting with Toggls' workspace API.
func (*RESTWorkspaceRepository) GetWorkspaces ¶
func (repository *RESTWorkspaceRepository) GetWorkspaces() ([]model.Workspace, error)
GetWorkspaces returns all workspaces for the current user.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package date provides functions for parsing and formatting dates according the requirements of Toggl (ISO 8601).
|
Package date provides functions for parsing and formatting dates according the requirements of Toggl (ISO 8601). |
|
Package main implements a simple sample implementation of the Toggl API for go (github.com/andreaskoch/togglapi).
|
Package main implements a simple sample implementation of the Toggl API for go (github.com/andreaskoch/togglapi). |
|
Package model contains the models and interface for the Toggl API
|
Package model contains the models and interface for the Toggl API |