Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(bool bool) *bool
- func BuildPath(resourcePath string, unescapedPath string) string
- func CheckRequired(iStruct interface{}) error
- func CreateError(i interface{}, name string) error
- func Interface() interface{}
- func JSONEmptyValue(v reflect.Type) string
- func NewReader(ctx context.Context, r io.Reader) io.Reader
- func PathEscape(path string) string
- func String(string string) *string
- func UnWrapBool(b *bool) bool
- type ExportValues
- type Iter
- func (i *Iter) Current() interface{}
- func (i *Iter) EOFPage() bool
- func (i *Iter) Err() error
- func (i *Iter) ExportParams() (ExportValues, error)
- func (i *Iter) GetCursor() string
- func (i *Iter) GetPage() bool
- func (i *Iter) GetParams() *ListParams
- func (i *Iter) Next() bool
- func (i *Iter) Paging() bool
- func (i *Iter) SetCursor(cursor string)
- type IterChan
- type IterI
- type IterPagingI
- type ListParams
- type ListParamsContainer
- type Params
- type ProgressWriter
- type Query
- type Values
- type WithContextReader
Constants ¶
const (
BasePart = int64(1024*1024*5 + 1024*1024/3)
)
Variables ¶
var PartSizes = partSizes()
PartSizes return 10k parts that add up to 4.9 TB
var QueryEscape = url.QueryEscape
Functions ¶
func CheckRequired ¶
func CheckRequired(iStruct interface{}) error
func CreateError ¶
func JSONEmptyValue ¶
func PathEscape ¶
func UnWrapBool ¶
Types ¶
type ExportValues ¶
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) ExportParams ¶
func (i *Iter) ExportParams() (ExportValues, error)
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 IterChan ¶
type IterPagingI ¶
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.