Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) ConvertIntoFullTimeEntry(tei dto.TimeEntryImpl) (dto.TimeEntry, error)
- func (c *Client) CreateTimeEntry(p CreateTimeEntryParam) (dto.TimeEntryImpl, error)
- func (c *Client) CurrentUser() (dto.User, error)
- func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)
- func (c *Client) GetProject(p GetProjectParam) (*dto.Project, error)
- func (c *Client) GetProjects(p GetProjectsParam) ([]dto.Project, error)
- func (c *Client) GetRecentTimeEntries(p GetRecentTimeEntries) (dto.TimeEntriesList, error)
- func (c *Client) GetTag(p GetTagParam) (*dto.Tag, error)
- func (c *Client) GetTags(p GetTagsParam) ([]dto.Tag, error)
- func (c *Client) GetTask(p GetTaskParam) (*dto.Task, error)
- func (c *Client) GetTimeEntry(p GetTimeEntryParam) (timeEntry *dto.TimeEntryImpl, err error)
- func (c *Client) GetUser(id string) (*dto.User, error)
- func (c *Client) Log(p LogParam) ([]dto.TimeEntry, error)
- func (c *Client) LogInProgress(p LogInProgressParam) (*dto.TimeEntryImpl, 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)
- func (c *Client) Workspaces(f WorkspacesFilter) ([]dto.Workspace, error)
- type CreateTimeEntryParam
- type GetProjectParam
- type GetProjectsParam
- type GetRecentTimeEntries
- type GetTagParam
- type GetTagsParam
- type GetTaskParam
- type GetTimeEntryParam
- type LogInProgressParam
- type LogParam
- type LogRangeParam
- type Logger
- type OutParam
- type PaginationParam
- type QueryAppender
- type UpdateTimeEntryParam
- type WorkspaceUsersParam
- type WorkspacesFilter
Constants ¶
This section is empty.
Variables ¶
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"}
ErrorNotFound Not Found
Functions ¶
This section is empty.
Types ¶
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) ConvertIntoFullTimeEntry ¶
ConvertIntoFullTimeEntry converts a dto.TimeEntryImpl into a dto.TimeEntry
func (*Client) CreateTimeEntry ¶
func (c *Client) CreateTimeEntry(p CreateTimeEntryParam) (dto.TimeEntryImpl, error)
CreateTimeEntry create a new time entry
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) GetRecentTimeEntries ¶
func (c *Client) GetRecentTimeEntries(p GetRecentTimeEntries) (dto.TimeEntriesList, error)
GetRecentTimeEntries will return the recent time entries of the user, paginated
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) GetTask ¶
func (c *Client) GetTask(p GetTaskParam) (*dto.Task, error)
GetTask get a single Task, if exists
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) LogInProgress ¶
func (c *Client) LogInProgress(p LogInProgressParam) (*dto.TimeEntryImpl, error)
LogInProgress show time entry in progress (if any)
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
func (*Client) Workspaces ¶
func (c *Client) Workspaces(f WorkspacesFilter) ([]dto.Workspace, error)
Workspaces list all the user's workspaces
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 GetProjectParam ¶
GetProjectParam params to get a Project
type GetProjectsParam ¶
type GetProjectsParam struct {
Workspace string
}
GetProjectsParam params to get all project of a workspace
type GetRecentTimeEntries ¶
GetRecentTimeEntries params to get recent time entries
type GetTagParam ¶
GetTagParam params to find a tag
type GetTagsParam ¶
type GetTagsParam struct {
Workspace string
}
GetTagsParam params to get all tags of a workspace
type GetTaskParam ¶
GetTaskParam params to get a Task
type GetTimeEntryParam ¶ added in v0.1.7
type LogInProgressParam ¶
type LogInProgressParam struct {
Workspace string
}
LogInProgressParam params to query entries
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 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
type QueryAppender ¶ added in v0.1.5
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
type WorkspacesFilter ¶
type WorkspacesFilter struct {
Name string
}
WorkspacesFilter will be used to filter the workspaces