Documentation ¶
Index ¶
- Variables
- type AddClientParam
- type AddProjectParam
- type AddTaskParam
- type ChangeInvoicedParam
- type Client
- func (c *Client) AddClient(p AddClientParam) (dto.Client, error)
- func (c *Client) AddProject(p AddProjectParam) (dto.Project, error)
- func (c *Client) AddTask(p AddTaskParam) (dto.Task, error)
- func (c *Client) ChangeInvoiced(p ChangeInvoicedParam) error
- func (c *Client) CreateTimeEntry(p CreateTimeEntryParam) (dto.TimeEntryImpl, error)
- func (c *Client) DeleteTimeEntry(p DeleteTimeEntryParam) error
- func (c *Client) Do(req *http.Request, v interface{}, name string) (*http.Response, error)
- func (c *Client) GetClients(p GetClientsParam) ([]dto.Client, error)
- func (c *Client) GetHydratedTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntry, err error)
- func (c *Client) GetHydratedTimeEntryInProgress(p GetTimeEntryInProgressParam) (timeEntry *dto.TimeEntry, err error)
- func (c *Client) GetMe() (dto.User, error)
- func (c *Client) GetProject(p GetProjectParam) (*dto.Project, error)
- func (c *Client) GetProjects(p GetProjectsParam) ([]dto.Project, error)
- func (c *Client) GetTag(p GetTagParam) (*dto.Tag, error)
- func (c *Client) GetTags(p GetTagsParam) ([]dto.Tag, error)
- func (c *Client) GetTasks(p GetTasksParam) ([]dto.Task, error)
- func (c *Client) GetTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntryImpl, err error)
- func (c *Client) GetTimeEntryInProgress(p GetTimeEntryInProgressParam) (timeEntryImpl *dto.TimeEntryImpl, err error)
- func (c *Client) GetUser(p GetUser) (dto.User, error)
- func (c *Client) GetUserTimeEntries(p GetUserTimeEntriesParam) ([]dto.TimeEntryImpl, error)
- func (c *Client) GetUsersHydratedTimeEntries(p GetUserTimeEntriesParam) ([]dto.TimeEntry, error)
- func (c *Client) GetWorkspace(p GetWorkspace) (dto.Workspace, error)
- func (c *Client) GetWorkspaces(f GetWorkspaces) ([]dto.Workspace, error)
- func (c *Client) Log(p LogParam) ([]dto.TimeEntry, error)
- func (c *Client) LogRange(p LogRangeParam) ([]dto.TimeEntry, error)
- func (c *Client) NewRequest(method, uri string, body interface{}) (*http.Request, error)
- func (c *Client) Out(p OutParam) error
- func (c *Client) SetDebugLogger(logger Logger) *Client
- func (c *Client) UpdateTimeEntry(p UpdateTimeEntryParam) (dto.TimeEntryImpl, error)
- func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error)
- type CreateTimeEntryParam
- type DeleteTimeEntryParam
- type GetClientsParam
- type GetProjectParam
- type GetProjectsParam
- type GetTagParam
- type GetTagsParam
- type GetTasksParam
- type GetTimeEntryInProgressParam
- type GetTimeEntryParam
- type GetUser
- type GetUserTimeEntriesParam
- type GetWorkspace
- type GetWorkspaces
- type LogParam
- type LogRangeParam
- type Logger
- type OutParam
- type PaginationParam
- type QueryAppender
- type UpdateTimeEntryParam
- type WorkspaceUsersParam
Constants ¶
This section is empty.
Variables ¶
var ErrorForbidden = dto.Error{Message: "Forbidden", Code: 403}
ErrorForbidden Forbidden
var ErrorMissingAPIKey = errors.New("api Key must be informed")
ErrorMissingAPIKey returned if X-Api-Key is missing
var ErrorNotFound = dto.Error{Message: "Nothing was found", Code: 404}
ErrorNotFound Not Found
Functions ¶
This section is empty.
Types ¶
type AddClientParam ¶ added in v0.31.0
type AddProjectParam ¶ added in v0.31.0
type AddTaskParam ¶ added in v0.31.0
AddTaskParam param to add tasks to a project
type ChangeInvoicedParam ¶ added in v0.24.0
type Client ¶
Client will help to access Clockify API
func NewClient ¶
NewClient create a new Client, based on: https://clockify.github.io/clockify_api_docs/
func (*Client) AddClient ¶ added in v0.31.0
func (c *Client) AddClient(p AddClientParam) (dto.Client, error)
AddClient adds a new client to a workspace
func (*Client) AddProject ¶ added in v0.31.0
func (c *Client) AddProject(p AddProjectParam) (dto.Project, error)
AddProject adds a new project to a workspace
func (*Client) AddTask ¶ added in v0.31.0
func (c *Client) AddTask(p AddTaskParam) (dto.Task, error)
func (*Client) ChangeInvoiced ¶ added in v0.24.0
func (c *Client) ChangeInvoiced(p ChangeInvoicedParam) error
ChangeInvoiced changes time entries to invoiced or not
func (*Client) CreateTimeEntry ¶
func (c *Client) CreateTimeEntry(p CreateTimeEntryParam) (dto.TimeEntryImpl, error)
CreateTimeEntry create a new time entry
func (*Client) DeleteTimeEntry ¶ added in v0.11.0
func (c *Client) DeleteTimeEntry(p DeleteTimeEntryParam) error
DeleteTimeEntry deletes a time entry
func (*Client) GetClients ¶ added in v0.31.0
func (c *Client) GetClients(p GetClientsParam) ([]dto.Client, error)
GetClients gets all clients of a workspace
func (*Client) GetHydratedTimeEntry ¶ added in v0.22.0
func (c *Client) GetHydratedTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntry, err error)
func (*Client) GetHydratedTimeEntryInProgress ¶ added in v0.22.0
func (c *Client) GetHydratedTimeEntryInProgress(p GetTimeEntryInProgressParam) (timeEntry *dto.TimeEntry, err error)
GetHydratedTimeEntryInProgress show hydrated time entry in progress (if any)
func (*Client) GetProject ¶
func (c *Client) GetProject(p GetProjectParam) (*dto.Project, error)
GetProject get a single Project, if exists
func (*Client) GetProjects ¶
func (c *Client) GetProjects(p GetProjectsParam) ([]dto.Project, error)
GetProjects get all project of a workspace
func (*Client) GetTag ¶
func (c *Client) GetTag(p GetTagParam) (*dto.Tag, error)
GetTag get a single tag, if it exists
func (*Client) GetTags ¶
func (c *Client) GetTags(p GetTagsParam) ([]dto.Tag, error)
GetTags get all tags of a workspace
func (*Client) GetTasks ¶ added in v0.23.0
func (c *Client) GetTasks(p GetTasksParam) ([]dto.Task, error)
GetTasks get tasks of a project
func (*Client) GetTimeEntry ¶ added in v0.1.7
func (c *Client) GetTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntryImpl, err error)
GetTimeEntry will retrieve a Time Entry using its Workspace and ID
func (*Client) GetTimeEntryInProgress ¶ added in v0.22.0
func (c *Client) GetTimeEntryInProgress(p GetTimeEntryInProgressParam) (timeEntryImpl *dto.TimeEntryImpl, err error)
GetTimeEntryInProgress show time entry in progress (if any)
func (*Client) GetUserTimeEntries ¶ added in v0.24.0
func (c *Client) GetUserTimeEntries(p GetUserTimeEntriesParam) ([]dto.TimeEntryImpl, error)
GetUserTimeEntries will list the time entries of a user on a workspace, can be paginated
func (*Client) GetUsersHydratedTimeEntries ¶ added in v0.24.0
func (c *Client) GetUsersHydratedTimeEntries(p GetUserTimeEntriesParam) ([]dto.TimeEntry, error)
GetUsersHydratedTimeEntries will list hydrated time entries of a user on a workspace, can be paginated
func (*Client) GetWorkspace ¶ added in v0.18.0
func (c *Client) GetWorkspace(p GetWorkspace) (dto.Workspace, error)
func (*Client) GetWorkspaces ¶ added in v0.15.0
func (c *Client) GetWorkspaces(f GetWorkspaces) ([]dto.Workspace, error)
Workspaces list all the user's workspaces
func (*Client) LogRange ¶ added in v0.1.2
func (c *Client) LogRange(p LogRangeParam) ([]dto.TimeEntry, error)
LogRange list time entries by date range
func (*Client) NewRequest ¶
NewRequest to be used in Client
func (*Client) SetDebugLogger ¶
SetDebugLogger debug logger
func (*Client) UpdateTimeEntry ¶
func (c *Client) UpdateTimeEntry(p UpdateTimeEntryParam) (dto.TimeEntryImpl, error)
UpdateTimeEntry update a time entry
func (*Client) WorkspaceUsers ¶
func (c *Client) WorkspaceUsers(p WorkspaceUsersParam) ([]dto.User, error)
WorkspaceUsers all users in a Workspace
type CreateTimeEntryParam ¶
type CreateTimeEntryParam struct { Workspace string Start time.Time End *time.Time Billable bool Description string ProjectID string TaskID string TagIDs []string }
CreateTimeEntryParam params to create a new time entry
type DeleteTimeEntryParam ¶ added in v0.11.0
DeleteTimeEntryParam params to update a new time entry
type GetClientsParam ¶ added in v0.31.0
type GetClientsParam struct { Workspace string Name string Archived *bool PaginationParam }
GetClientsParam params to get all clients of a workspace
type GetProjectParam ¶
GetProjectParam params to get a Project
type GetProjectsParam ¶
type GetProjectsParam struct { Workspace string Name string Clients []string Archived *bool PaginationParam }
GetProjectsParam params to get all project of a workspace
type GetTagParam ¶
GetTagParam params to find a tag
type GetTagsParam ¶
type GetTagsParam struct { Workspace string Name string Archived bool PaginationParam }
GetTagsParam params to get all tags of a workspace
type GetTasksParam ¶ added in v0.23.0
type GetTasksParam struct { Workspace string ProjectID string Active bool Name string PaginationParam }
GetTasksParam param to find tasks of a project
type GetTimeEntryInProgressParam ¶ added in v0.22.0
GetTimeEntryInProgressParam params to query entries
type GetTimeEntryParam ¶ added in v0.1.7
GetTimeEntryParam params to get a Time Entry
type GetUserTimeEntriesParam ¶ added in v0.24.0
type GetWorkspace ¶ added in v0.18.0
type GetWorkspace struct {
ID string
}
type GetWorkspaces ¶ added in v0.15.0
type GetWorkspaces struct {
Name string
}
GetWorkspaces will be used to filter the workspaces
type LogParam ¶
type LogParam struct { Workspace string UserID string Date time.Time PaginationParam }
LogParam params to query entries
type LogRangeParam ¶ added in v0.1.2
type LogRangeParam struct { Workspace string UserID string FirstDate time.Time LastDate time.Time Description string PaginationParam }
LogRangeParam params to query entries
type Logger ¶
type Logger interface { Print(v ...interface{}) Printf(format string, v ...interface{}) Println(v ...interface{}) }
Logger for the Client
type PaginationParam ¶ added in v0.1.7
PaginationParam parameters about pagination
func AllPages ¶ added in v0.30.0
func AllPages() PaginationParam
AllPages sets the query to retrieve all pages
type QueryAppender ¶ added in v0.1.5
QueryAppender an interface to identify if the parameters should be sent through the query or body
type UpdateTimeEntryParam ¶
type UpdateTimeEntryParam struct { Workspace string TimeEntryID string Start time.Time End *time.Time Billable bool Description string ProjectID string TaskID string TagIDs []string }
UpdateTimeEntryParam params to update a new time entry
type WorkspaceUsersParam ¶
WorkspaceUsersParam params to query workspace users