Documentation ¶
Index ¶
- Variables
- func Bool(bool bool) *bool
- func BuildPath(resourcePath string, unescapedPath string) string
- func CheckRequired(iStruct interface{}, values *url.Values) error
- func CreateError(i interface{}, name string) error
- func ExportParams(i interface{}) (url.Values, error)
- func Interface() interface{}
- func NewReader(ctx context.Context, r io.Reader) io.Reader
- func PathEscape(path string) string
- func String(string string) *string
- type Iter
- func (i *Iter) Current() interface{}
- func (i *Iter) EOFPage() bool
- func (i *Iter) Err() error
- func (i *Iter) ExportParams() (url.Values, error)
- func (i *Iter) GetCursor() string
- func (i *Iter) GetPage() bool
- func (i *Iter) GetParams() *ListParams
- func (i *Iter) Next() bool
- func (i *Iter) SetCursor(cursor string)
- type ListParams
- type ListParamsContainer
- type ProgressWriter
- type Query
- type WithContextReader
Constants ¶
This section is empty.
Variables ¶
var PartSizes = partSizes()
PartSizes return 10k parts that add up to 4.9 TB
var QueryEscape = url.QueryEscape
Functions ¶
func CheckRequired ¶
func CreateError ¶
func ExportParams ¶
func PathEscape ¶
Types ¶
type Iter ¶
type Iter struct { Query ListParams ListParamsContainer Params []interface{} CurrentIndex int Values *[]interface{} Cursor string Error error }
func (*Iter) Err ¶
Err returns the error, if any, that caused the Iter to stop. It must be inspected after Next returns false.
func (*Iter) GetParams ¶
func (i *Iter) GetParams() *ListParams
func (*Iter) Next ¶
Next iterates the results in i.Current() or i.`ResourceName`(). It returns true until there are no results remaining. To adjust the number of results set ListParams.PerPage. To have it auto-paginate set ListParams.MaxPages, default is 1.
To iterate over all results use the following pattern.
for i.Next() { i.Current() }
type ListParams ¶
type ListParams struct { Page int64 `json:"page,omitempty" url:"page,omitempty" required:"false"` PerPage int64 `json:"per_page,omitempty" url:"per_page,omitempty" required:"false"` Cursor string `json:"cursor,omitempty" url:"cursor,omitempty" required:"false"` MaxPages int64 `json:"-" url:"-"` }
func (*ListParams) GetListParams ¶
func (p *ListParams) GetListParams() *ListParams
GetListParams returns a ListParams struct (itself). It exists because any structs that embed ListParams will inherit it, and thus implement the ListParamsContainer interface.
type ListParamsContainer ¶
type ListParamsContainer interface {
GetListParams() *ListParams
}
ListParamsContainer is a general interface for which all list parameter structs should comply. They achieve this by embedding a ListParams struct and inheriting its implementation of this interface.