reliablereq

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush()

Types

type ReliableRequest

type ReliableRequest struct {
	Headers          map[string]string
	HTTPClient       *http.Client
	EnableCache      bool
	TTLCache         time.Duration
	EnableStaleCache bool
	TTLStaleCache    time.Duration
	// contains filtered or unexported fields
}

ReliableRequest - a struct holding params to make reliable requests

func NewReliableRequest

func NewReliableRequest() *ReliableRequest

NewReliableRequest - create a new ReliableRequest

func (*ReliableRequest) Get

func (rr *ReliableRequest) Get(url string) (string, error)

Get - returns the requested data as string and a possible error

func (*ReliableRequest) GetCache added in v0.0.2

func (rr *ReliableRequest) GetCache(key string) (string, bool)

func (*ReliableRequest) UpdateHystrixConfig

func (rr *ReliableRequest) UpdateHystrixConfig(name string, conf hystrix.CommandConfig)

UpdateHystrixConfig - configure a new circuit breaker

Jump to

Keyboard shortcuts

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