Documentation
¶
Index ¶
- func BasicHttpRequestReturnStruct(httpMethod string, url string, target interface{}) error
- func GetCacheAndStalenessReturnStruct(cacheFilename string, cacheTTLOverride time.Duration, allowCacheUpdate bool, ...) (bool, error)
- func HttpRequestReturnStruct(httpMethod string, url string, headers map[string][]string, ...) error
- func WriteStringToCacheFile(filename string, value string) error
- func WriteStructToCacheFile(filename string, rawStruct interface{}) error
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicHttpRequestReturnStruct ¶
BasicHttpRequestReturnStruct makes a request with default parameters
func GetCacheAndStalenessReturnStruct ¶ added in v1.1.0
func GetCacheAndStalenessReturnStruct(cacheFilename string, cacheTTLOverride time.Duration, allowCacheUpdate bool, target interface{}) (bool, error)
GetCacheAndStalenessReturnStruct is the same as GetCacheAndStaleness but it returns the result as a specified struct. GetCacheAndStalenessReturnStruct returns the contents of the cache file as a struct and whether or not the cache is stale (this does not make an HTTP request)
func HttpRequestReturnStruct ¶
func HttpRequestReturnStruct(httpMethod string, url string, headers map[string][]string, cacheTTLOverride time.Duration, allowCacheUpdate bool, target interface{}) error
HttpRequestReturnStruct is the same as HttpRequest but it returns the result as a specified struct. HttpRequest sends an HTTP request to the specified URL and returns the HTTP response. The response is cached for a duration specified by cacheTTL. If cacheTTLOverride is zero, the default cache TTL value is used.
func WriteStringToCacheFile ¶ added in v1.1.0
func WriteStructToCacheFile ¶ added in v1.1.0
Types ¶
type Response ¶
func BasicHttpRequest ¶
BasicHttpRequest makes a request with default parameters
func GetCacheAndStaleness ¶ added in v1.1.0
func GetCacheAndStaleness(cacheFilename string, cacheTTLOverride time.Duration, allowCacheUpdate bool) (Response, bool, error)
GetCacheAndStaleness returns the contents of the cache file and whether or not the cache is stale (this does not make an HTTP request)
func HttpRequest ¶
func HttpRequest(httpMethod string, url string, headers map[string][]string, cacheTTLOverride time.Duration, allowCacheUpdate bool) (Response, error)
HttpRequest sends an HTTP request to the specified URL and returns the HTTP response. The response is cached for a duration specified by cacheTTL. If cacheTTLOverride is zero, the default cache TTL value is used.