Documentation
¶
Overview ¶
Package api provides HTTP client for GitScrum API
Package api provides shared types for the GitScrum API
Index ¶
- func DecodeResponse(resp *http.Response, target interface{}) error
- type APIError
- type Client
- func (c *Client) Delete(path string) (*http.Response, error)
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) Patch(path string, body interface{}) (*http.Response, error)
- func (c *Client) Post(path string, body interface{}) (*http.Response, error)
- func (c *Client) Put(path string, body interface{}) (*http.Response, error)
- func (c *Client) Request(method, path string, body interface{}) (*http.Response, error)
- type DateResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
DecodeResponse decodes JSON response body into target struct
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
Message string
Errors map[string][]string `json:"errors,omitempty"`
}
APIError represents an error from the API
type Client ¶
Client handles HTTP requests to GitScrum API
type DateResource ¶
type DateResource struct {
DateForHumans string `json:"date_for_humans"`
ISO8601 string `json:"iso8601"`
Timestamp int64 `json:"timestamp"`
}
DateResource represents a date object from the API (DateResource.php) All dates in the API are returned in this format with timezone-aware fields.
func (*DateResource) DateTime ¶
func (d *DateResource) DateTime() string
DateTime returns date and time (YYYY-MM-DD HH:MM) from ISO8601
func (*DateResource) FormatDate ¶
func (d *DateResource) FormatDate() string
FormatDate returns the human-readable date or ISO8601 fallback
func (*DateResource) FormatISO ¶
func (d *DateResource) FormatISO() string
FormatISO returns the ISO8601 date string
func (*DateResource) ISODate ¶
func (d *DateResource) ISODate() string
ISODate returns just the date portion (YYYY-MM-DD) from ISO8601
Click to show internal directories.
Click to hide internal directories.