fetcher

package
v0.0.0-...-82e36bc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRetryLimitReached = errors.New("reached retry limit")

Functions

func MockResponseFor

func MockResponseFor(key string) structs.Response

func NewIPApi

func NewIPApi(logger zerolog.Logger, reverser reverse.Reverser) (*ipApi, error)

Types

type Client

type Client interface {
	Fetch(map[string]*structs.CacheEntry) error
	FetchSelf(lang string, fields field.Fields) (structs.Response, error)
	Debug() interface{}
}

type Mock

type Mock struct {
	sync.Mutex
	Requests []int // batch size of each batch request.
}

func (*Mock) Debug

func (mo *Mock) Debug() interface{}

func (*Mock) Fetch

func (mo *Mock) Fetch(m map[string]*structs.CacheEntry) error

func (*Mock) FetchSelf

func (mo *Mock) FetchSelf(lang string, fields field.Fields) (structs.Response, error)

Jump to

Keyboard shortcuts

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