Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present.
Types ¶
type Client ¶
type Client struct { // Identifier used for requesting token and communicating with the API ApplicationIdentifier string // Login service Login *LoginService // TimeTrack service TimeTrack *TimeTrackService // contains filtered or unexported fields }
Client for Auxilium's API
func NewClient ¶
NewClient return a new Auxlium API Client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide a valid private token.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type ErrorResponse ¶
An ErrorResponse reports one or more errors caused by an API request.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type LoginService ¶
type LoginService struct {
// contains filtered or unexported fields
}
LoginService provides a way to fetch an authentification token from Auxilium
func (*LoginService) Authenticate ¶
func (l *LoginService) Authenticate(userName string, password string) (string, *http.Response, error)
Authenticate sends the userName and password and return a token
type TimeTrack ¶
type TimeTrack struct { Id int `json:"id,omitempty"` ProjectId int `json:"project_id,omitempty"` Started string `json:"started,omitempty"` Duration int `json:"duration,omitempty"` Notes int `json:"notes,omitempty"` Billable bool `json:"billable,omitempty"` Profile string `json:"profile,omitempty"` Direction bool `json:"direction,omitempty"` Status string `json:"status,omitempty"` Tickets []int `json:"tickets,omitempty"` Clients []int `json:"clients,omitempty"` Tags []string `json:"tags,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` UserId int `json:"user_id,omitempty"` }
A TimeTrack represents a unit of work