Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilterMode ¶
type FilterMode bool
FilterMode - batch filter mode
const ( // Allow mode Allow FilterMode = true // Ignore mode Ignore FilterMode = false )
type Option ¶
type Option func(*Packer)
Option - Packer option
func MaxPackedRequests ¶
MaxPackedRequests sets the maximum API calls inside one batch.
func Rules ¶
func Rules(mode FilterMode, methods ...string) Option
Rules sets the batching rules (ignore some methods or allow it).
type Packer ¶
type Packer struct {
// contains filtered or unexported fields
}
Packer struct
func New ¶
New creates a new Packer.
NOTE: this method will not create any trigger for sending batches which means that the batch will be sent only when the number of requests in it equals to 'maxPackedRequests' (default 25, can be overwritten with MaxPackedRequests() option). You will need to create your custom logic which sometimes will call packer.Send() method to solve this.
Click to show internal directories.
Click to hide internal directories.