Documentation
¶
Overview ¶
Package request provides functionality for handling HTTP Requests including the insertion of configuration options into the request
Index ¶
- func ClearResources(r *http.Request) *http.Request
- func Clone(r *http.Request) (*http.Request, error)
- func GetBody(r *http.Request, maxSize ...int64) ([]byte, error)
- func GetBodyReader(r *http.Request) (io.ReadCloser, error)
- func SetBody(r *http.Request, body []byte)
- func SetResources(r *http.Request, rsc *Resources) *http.Request
- type Resources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearResources ¶
ClearResources removes Resources from the HTTP Request's context
func Clone ¶
Clone wraps the builtin Clone to use a deep clone of both the request body reader (when present) and the Trickster context data
func GetBodyReader ¶
func GetBodyReader(r *http.Request) (io.ReadCloser, error)
Types ¶
type Resources ¶
type Resources struct {
sync.Mutex
BackendOptions *bo.Options
PathConfig *po.Options
CacheConfig *co.Options
NoLock bool
CacheClient cache.Cache
BackendClient backends.Backend
AlternateCacheTTL time.Duration
TimeRangeQuery *timeseries.TimeRangeQuery
Tracer *tracing.Tracer
IsMergeMember bool
RequestBody []byte
MergeFunc merge.MergeFunc
MergeRespondFunc merge.RespondFunc
TSUnmarshaler timeseries.UnmarshalerFunc
TSMarshaler timeseries.MarshalWriterFunc
TSTransformer func(timeseries.Timeseries)
TS timeseries.Timeseries
TSReqestOptions *timeseries.RequestOptions
Response *http.Response
AuthResult *auth.AuthResult
AlreadyEncoded bool
Cancelable bool
}
Resources is a collection of resources a Trickster request would need to fulfill the client request This is stored in the client request's context for use by request handers.
func GetResources ¶
GetResources will return a casted Resource object from the HTTP Request's context
func NewResources ¶
func NewResources(oo *bo.Options, pathOpts *po.Options, cacheOpts *co.Options, c cache.Cache, client backends.Backend, t *tracing.Tracer, ) *Resources
NewResources returns a new Resources collection based on the provided inputs