Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidID(id string) bool
- type AddClientParam
- type AddProjectParam
- type AddTaskParam
- type ChangeInvoicedParam
- type Client
- type CreateTimeEntryParam
- type DeleteTaskParam
- type DeleteTimeEntryParam
- type EntityNotFound
- type GetClientsParam
- type GetProjectParam
- type GetProjectsParam
- type GetTagParam
- type GetTagsParam
- type GetTaskParam
- type GetTasksParam
- type GetTimeEntryInProgressParam
- type GetTimeEntryParam
- type GetUser
- type GetUserTimeEntriesParam
- type GetWorkspace
- type GetWorkspaces
- type InvalidIDError
- type LogParam
- type LogRangeParam
- type Logger
- type OutParam
- type PaginationParam
- type QueryAppender
- type RequiredFieldError
- type TaskStatus
- type UpdateProjectParam
- type UpdateTaskParam
- type UpdateTimeEntryParam
- type WorkspaceUsersParam
Constants ¶
const ( TaskStatusDefault = "" TaskStatusDone = "DONE" TaskStatusActive = "ACTIVE" )
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 ErrorMissingAPIURL = errors.New("api URL must be informed")
ErrorMissingAPIURL returned if base url is missing
var ErrorNotFound = dto.Error{Message: "Nothing was found", Code: 404}
ErrorNotFound Not Found
Functions ¶
Types ¶
type AddClientParam ¶ added in v0.31.0
type AddProjectParam ¶ added in v0.31.0
type AddTaskParam ¶ added in v0.31.0
type AddTaskParam struct { Workspace string ProjectID string Name string AssigneeIDs *[]string Estimate *time.Duration Status TaskStatus Billable *bool }
AddTaskParam param to add tasks to a project
type ChangeInvoicedParam ¶ added in v0.24.0
type Client ¶
type Client interface { // SetDebugLogger when set will output the responses of requests to the // logger SetDebugLogger(logger Logger) Client // SetInfoLogger when set will output which requests and params are used to // the logger SetInfoLogger(logger Logger) Client GetWorkspace(GetWorkspace) (dto.Workspace, error) GetWorkspaces(GetWorkspaces) ([]dto.Workspace, error) GetMe() (dto.User, error) GetUser(GetUser) (dto.User, error) WorkspaceUsers(WorkspaceUsersParam) ([]dto.User, error) AddClient(AddClientParam) (dto.Client, error) GetClients(GetClientsParam) ([]dto.Client, error) AddProject(AddProjectParam) (dto.Project, error) UpdateProject(UpdateProjectParam) (dto.Project, error) GetProject(GetProjectParam) (*dto.Project, error) GetProjects(GetProjectsParam) ([]dto.Project, error) AddTask(AddTaskParam) (dto.Task, error) DeleteTask(DeleteTaskParam) (dto.Task, error) GetTask(GetTaskParam) (dto.Task, error) GetTasks(GetTasksParam) ([]dto.Task, error) UpdateTask(UpdateTaskParam) (dto.Task, error) GetTag(GetTagParam) (*dto.Tag, error) GetTags(GetTagsParam) ([]dto.Tag, error) ChangeInvoiced(ChangeInvoicedParam) error CreateTimeEntry(CreateTimeEntryParam) (dto.TimeEntryImpl, error) DeleteTimeEntry(DeleteTimeEntryParam) error GetHydratedTimeEntry(GetTimeEntryParam) (*dto.TimeEntry, error) GetHydratedTimeEntryInProgress(GetTimeEntryInProgressParam) (*dto.TimeEntry, error) GetTimeEntry(GetTimeEntryParam) (*dto.TimeEntryImpl, error) GetTimeEntryInProgress(GetTimeEntryInProgressParam) (*dto.TimeEntryImpl, error) GetUserTimeEntries(GetUserTimeEntriesParam) ([]dto.TimeEntryImpl, error) GetUsersHydratedTimeEntries(GetUserTimeEntriesParam) ([]dto.TimeEntry, error) Log(LogParam) ([]dto.TimeEntry, error) LogRange(LogRangeParam) ([]dto.TimeEntry, error) UpdateTimeEntry(UpdateTimeEntryParam) (dto.TimeEntryImpl, error) Out(OutParam) error }
Client will help to access Clockify API
func NewClient ¶
NewClient create a new Client, based on: https://clockify.github.io/clockify_api_docs/
func NewClientFromUrlAndKey ¶ added in v0.40.0
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 DeleteTaskParam ¶ added in v0.35.0
DeleteTaskParam param to update tasks to a project
type DeleteTimeEntryParam ¶ added in v0.11.0
DeleteTimeEntryParam params to update a new time entry
type EntityNotFound ¶ added in v0.36.0
func (EntityNotFound) Error ¶ added in v0.36.0
func (e EntityNotFound) Error() string
func (EntityNotFound) Unwrap ¶ added in v0.36.0
func (e EntityNotFound) Unwrap() error
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 GetTaskParam ¶
GetTaskParam param to get a task on a project
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 InvalidIDError ¶ added in v0.36.0
InvalidIDError indicates that a field should be a valid ID, but it is not
func (InvalidIDError) Error ¶ added in v0.36.0
func (e InvalidIDError) Error() string
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 ProjectID 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 RequiredFieldError ¶ added in v0.36.0
type RequiredFieldError struct {
Field string
}
RequiredFieldError indicates that a field should be filled, but was not
func (RequiredFieldError) Error ¶ added in v0.36.0
func (e RequiredFieldError) Error() string
type TaskStatus ¶ added in v0.35.0
type TaskStatus string
type UpdateProjectParam ¶ added in v0.40.0
type UpdateProjectParam struct { Workspace string ID string Name string ClientId *string Color string Note *string Billable *bool Public *bool Archived *bool }
UpdateProjectParam sets the properties to change on a project Workspace and ID are required
type UpdateTaskParam ¶ added in v0.35.0
type UpdateTaskParam struct { Workspace string ProjectID string TaskID string Name string AssigneeIDs *[]string Estimate *time.Duration Status TaskStatus Billable *bool }
UpdateTaskParam param to update tasks to a project
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 ¶
type WorkspaceUsersParam struct { Workspace string Email string PaginationParam }
WorkspaceUsersParam params to query workspace users