Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fetch ¶
func Fetch(fc FetchConfig) ([]byte, error)
Fetch makes a request, and caches its response.
Types ¶
type FetchConfig ¶
type FetchConfig struct {
url.URL
// Method describes which request method to use.
Method string
// Body store the request's body.
Body []byte
http.Header
// Query is the url.Values form of the request's query params.
// These are to be encoded for use by URL's RawQuery.
Query url.Values
// TTL is the time to live for a request's response in cache
TTL time.Duration
}
FetchConfig holds all the information needed by dal.Fetch() to make a request.
func (*FetchConfig) NewRequest ¶ added in v0.6.0
func (fc *FetchConfig) NewRequest() (*http.Request, error)
NewRequest creates an http.Request from a FetchConfig.
func (*FetchConfig) String ¶ added in v0.6.0
func (fc *FetchConfig) String() string
String reassembles the URL and Query into a valid URL string.