Documentation ¶
Index ¶
- Variables
- func Join(parts ...interface{}) (p string)
- type APIError
- type AuthTransport
- type Client
- func (c Client) Create(ctx context.Context, path string, body interface{}, dest interface{}) error
- func (c Client) Delete(ctx context.Context, path string) error
- func (c *Client) Do(ctx context.Context, req *http.Request, val interface{}) (*http.Response, error)
- func (c Client) Get(ctx context.Context, path string, dest interface{}) error
- func (c Client) List(ctx context.Context, path string, cursor Cursor, dest interface{}) (Pagination, error)
- func (c Client) NewRequest(method string, path string, body interface{}) (*http.Request, error)
- func (c Client) Set(ctx context.Context, path string, body interface{}, dest interface{}) error
- func (c Client) Update(ctx context.Context, path string, body interface{}, dest interface{}) error
- func (c Client) With(options ...Option) Client
- type Cursor
- type Links
- type Option
- type Pagination
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongContentType = errors.New("wrong content type")
Functions ¶
Types ¶
type AuthTransport ¶
type AuthTransport struct { Token string Base http.RoundTripper }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) NewRequest ¶
type Cursor ¶
type Links ¶
type Links struct { // URL to the first page First string // URL to the last page Last string // URL to the current page Current string // URL to the previous page Prev string // URL to the next page Next string }
Provides direct links to the individual pages
type Option ¶
type Option func(*Client)
func WithHTTPClientOption ¶ added in v0.2.1
func WithUserAgent ¶
type Pagination ¶
type Pagination struct { // Cursor of the current request Cursor // Number of items on the current page ItemCount int // Total number of items TotalCount int // Total number of pages TotalPages int // Direct links to the individual pages Links Links }
func ParsePagination ¶
func ParsePagination(header http.Header) Pagination
Parses the pagination headers from the given http response.
func (Pagination) HasMore ¶
func (p Pagination) HasMore() bool
Click to show internal directories.
Click to hide internal directories.