batch

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Defaults *Defaults        `json:"defaults"`
	Requests []BatchedRequest `json:"requests"`
}

https://docs.kinto-storage.org/en/stable/api/1.x/batch.html

func NewBatch

func NewBatch(records []interface{}, perms *authz.Permissions, method, path string) *Batch

NewBatch returns a Batch whose inner requests are homogenous (Kinto allows for mixing requests within batch operations (say, for example, two POSTs of records and one GET of a collection)) however this API does not.

func NewBatches

func NewBatches(records []interface{}, maxRequests int, perms *authz.Permissions, method, path string) []*Batch

NewBatches returns a slice of Batch whose inner requests are homogenous (Kinto allows for mixing requests within batch operations (say, for example, two POSTs of records and one GET of a collection)) however this API does not.

maxRequest must be less-than-or equal to Kinto's configured "batch_max_requests". See Client.BatchMaxRequests for more information on how to retrieve this value programatically.

func (*Batch) Post

func (b *Batch) Post() string

type BatchedRequest

type BatchedRequest struct {
	Body *api.Payload `json:"body"`
}

type Defaults

type Defaults struct {
	Method string `json:"method"`
	Path   string `json:"path"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL