profile

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToContext

func ToContext(ctx context.Context, ep *Profile) context.Context

Types

type ContextType

type ContextType int
const ContextKey ContextType = 0

type Profile

type Profile struct {
	// ClientAcceptEncoding holds the Client's Accept-Encoding header value, as received
	ClientAcceptEncoding string
	// Supported is the Client-Accepted Encodings filtered against Trickster supported Encodings
	// represented as a bitmap
	Supported providers.Provider
	// SupportedHeaderVal is the Accept-Encoding value representation of the Supported byte
	// that is used when proxying to an origin
	SupportedHeaderVal string
	// NoTransform is true if the client sent a Cache-Control header with a 'no-transform' value
	NoTransform bool
	// ContentEncoding holds the Response's Content-Encoding header value, if any
	ContentEncoding string
	// ContentType holds the Response's Content-Type header value, if any
	ContentType string
	// CompressTypes is a lookup map of any Content Types that should be compressed
	CompressTypes sets.Set[string]
	// ContentEncodingNum is the numeric value for the ContentEncoding string
	ContentEncodingNum providers.Provider

	Level int // todo: set this at some point
}

func FromContext

func FromContext(ctx context.Context) *Profile

func (*Profile) ClientAcceptsEncoding

func (p *Profile) ClientAcceptsEncoding(enc providers.Provider) bool

func (*Profile) Clone

func (p *Profile) Clone() *Profile

func (*Profile) GetDecoderInitializer

func (p *Profile) GetDecoderInitializer() providers.DecoderInitializer

GetDecoderInitializer returns a decoder based on the profile's Content-Encoding header

func (*Profile) GetEncoderInitializer

func (p *Profile) GetEncoderInitializer() (providers.EncoderInitializer, string)

GetEncoderInitializer returns an encoder based on the profile's Content-Type and Accept-Encoding headers

func (*Profile) String

func (p *Profile) String() string

Jump to

Keyboard shortcuts

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