batchreq

package
v0.0.0-...-972b573 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListAll

func ListAll(listByPage ListByPage, limiter *rate.Limiter, timeout time.Duration) ([]interface{}, error)

func Query

func Query(count int, do func(index int) (interface{}, error), limiter *rate.Limiter, timeout time.Duration) ([]interface{}, error)

Types

type BatchRequest

type BatchRequest struct {
	// contains filtered or unexported fields
}

func New

func New(appKey, appSecret, url string, body request.Values, pageNumField, pageSizeField, totalField string) BatchRequest

func (*BatchRequest) Execute

func (batreq *BatchRequest) Execute() (<-chan request.Values, <-chan error)

request.Values 是每次请求的返回值(每页)

func (BatchRequest) PageCount

func (batreq BatchRequest) PageCount() int

type ListByPage

type ListByPage func(pageNumber int) (ListResponse, error)

type ListResponse

type ListResponse interface {
	Total() int
	PageCount() int
}

Jump to

Keyboard shortcuts

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