request

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package request provides functionality for handling HTTP Requests including the insertion of configuration options into the request

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetResources

func SetResources(r *http.Request, rsc *Resources) *http.Request

SetResources will save the Resources collection to the HTTP Request's context

Types

type Resources

type Resources struct {
	OriginConfig      *oo.Options
	PathConfig        *po.Options
	CacheConfig       *co.Options
	NoLock            bool
	CacheClient       cache.Cache
	OriginClient      origins.Client
	AlternateCacheTTL time.Duration
	TimeRangeQuery    *timeseries.TimeRangeQuery
	Tracer            *tracing.Tracer
	Logger            *tl.Logger
}

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

func GetResources(r *http.Request) *Resources

GetResources will return a casted Resource object from the HTTP Request's context

func NewResources

func NewResources(oo *oo.Options, po *po.Options, co *co.Options,
	c cache.Cache, client origins.Client, t *tracing.Tracer,
	logger *tl.Logger) *Resources

NewResources returns a new Resources collection based on the provided inputs

func (Resources) Clone

func (r Resources) Clone() *Resources

Clone returns an exact copy of the subject Resources collection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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