types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 10 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectiveNotPresent = errors.New("directive not present")

Functions

This section is empty.

Types

type Accept

type Accept struct {
	MediaRanges []*MediaRange
	Raw         string
}

func (*Accept) GetPriorityOrderedEncodings

func (accept *Accept) GetPriorityOrderedEncodings() []*MediaRange

type AcceptEncoding

type AcceptEncoding struct {
	Encodings []*Encoding
	Raw       string
}

func (*AcceptEncoding) GetPriorityOrderedEncodings

func (acceptEncoding *AcceptEncoding) GetPriorityOrderedEncodings() []*Encoding

type AcceptLanguage

type AcceptLanguage struct {
	LanguageQs []*LanguageQ
	Raw        string
}

func (*AcceptLanguage) GetPriorityOrderedLanguages

func (acceptLanguage *AcceptLanguage) GetPriorityOrderedLanguages() []*LanguageQ

type Authorization

type Authorization struct {
	Scheme  string
	Token68 string
	Params  map[string]string
}

func (*Authorization) String

func (authorization *Authorization) String() string

type CacheControl

type CacheControl struct {
	Directives []*CacheControlDirective
	Raw        string
}

func (*CacheControl) MaxAge

func (cacheControl *CacheControl) MaxAge() (int, error)

func (*CacheControl) MaxStale

func (cacheControl *CacheControl) MaxStale() (int, bool, error)

func (*CacheControl) MinFresh

func (cacheControl *CacheControl) MinFresh() (int, error)

func (*CacheControl) MustRevalidate

func (cacheControl *CacheControl) MustRevalidate() bool

func (*CacheControl) MustUnderstand

func (cacheControl *CacheControl) MustUnderstand() bool

func (*CacheControl) NoCache

func (cacheControl *CacheControl) NoCache() bool

func (*CacheControl) NoCacheFieldNames

func (cacheControl *CacheControl) NoCacheFieldNames() []string

func (*CacheControl) NoStore

func (cacheControl *CacheControl) NoStore() bool

func (*CacheControl) NoTransform

func (cacheControl *CacheControl) NoTransform() bool

func (*CacheControl) OnlyIfCached

func (cacheControl *CacheControl) OnlyIfCached() bool

func (*CacheControl) Private

func (cacheControl *CacheControl) Private() bool

func (*CacheControl) PrivateFieldNames

func (cacheControl *CacheControl) PrivateFieldNames() []string

func (*CacheControl) ProxyRevalidate

func (cacheControl *CacheControl) ProxyRevalidate() bool

func (*CacheControl) Public

func (cacheControl *CacheControl) Public() bool

func (*CacheControl) SMaxAge

func (cacheControl *CacheControl) SMaxAge() (int, error)

type CacheControlDirective

type CacheControlDirective struct {
	Name  string
	Value string
}

type ContentDisposition

type ContentDisposition struct {
	DispositionType     string
	Filename            string
	FilenameAsterisk    string
	ExtensionParameters map[string]string
}

type ContentNegotiation

type ContentNegotiation struct {
	Accept         *Accept
	AcceptEncoding *AcceptEncoding
	AcceptLanguage *AcceptLanguage

	NegotiatedAccept         string
	NegotiatedAcceptEncoding string
}

type ContentType

type ContentType struct {
	MediaType
}

type CorsConfiguration

type CorsConfiguration struct {
	Origin        string
	Methods       []string
	Headers       []string
	Credentials   bool
	MaxAge        int
	ExposeHeaders []string
}

type ETag

type ETag struct {
	Weak bool
	Tag  string
}

func (*ETag) String

func (etag *ETag) String() string

type Encoding

type Encoding struct {
	Coding       string
	QualityValue float32
}

type Forwarded

type Forwarded struct {
	Elements []*ForwardedElement
}

Forwarded represents the parsed Forwarded HTTP header as defined in RFC 7239. The header can contain multiple elements, each potentially originating from different proxies in the request chain.

type ForwardedElement

type ForwardedElement struct {
	For   string
	By    string
	Host  string
	Proto string
	// Extensions contain any non-standard parameters
	Extensions map[string]string
}

ForwardedElement represents a single forwarded element containing multiple parameters. Standard parameters defined in RFC 7239 are:

  • For: identifies the node making the request to the proxy
  • By: identifies the interface where the request came in to the proxy
  • Host: the original value of the Host request header
  • Proto: indicates the protocol used to make the request (http or https)

type HttpContext

type HttpContext struct {
	Request      *http.Request
	RequestBody  []byte
	Response     *http.Response
	ResponseBody []byte
	Reporting    *schema.HttpReporting
	TlsContext   *motmedelTlsTypes.TlsContext
	User         *schema.User
	Extra        []*HttpContext
	LocalAddr    net.Addr
	RemoteAddr   net.Addr
}

type LanguageQ

type LanguageQ struct {
	Tag *LanguageTag
	Q   float32
}

type LanguageTag

type LanguageTag struct {
	PrimarySubtag string
	Subtag        string
}

type MediaRange

type MediaRange struct {
	Type       string
	Subtype    string
	Parameters [][2]string
	Weight     float32
}

func (*MediaRange) GetFullType

func (mediaRange *MediaRange) GetFullType(normalize bool) string

func (*MediaRange) GetParameterMap

func (mediaRange *MediaRange) GetParameterMap(normalize bool) map[string]string

func (*MediaRange) GetStructuredSyntaxName

func (mediaRange *MediaRange) GetStructuredSyntaxName(normalize bool) string

type MediaType

type MediaType struct {
	Type       string
	Subtype    string
	Parameters [][2]string
}

func (*MediaType) GetFullType

func (mediaType *MediaType) GetFullType(normalize bool) string

func (*MediaType) GetParametersMap

func (mediaType *MediaType) GetParametersMap(normalize bool) map[string]string

func (*MediaType) GetStructuredSyntaxName

func (mediaType *MediaType) GetStructuredSyntaxName(normalize bool) string

type RetryAfter

type RetryAfter struct {
	// The time can be either a timestamp or a duration.
	WaitTime any
	Raw      string
}

type RobotsTxt

type RobotsTxt struct {
	Groups []*RobotsTxtGroup
}

func (*RobotsTxt) String

func (robotsTxt *RobotsTxt) String() string

type RobotsTxtGroup

type RobotsTxtGroup struct {
	UserAgents   []string
	Disallowed   []string
	Allowed      []string
	OtherRecords [][2]string
}

func (*RobotsTxtGroup) String

func (robotsTxtGroup *RobotsTxtGroup) String() string

type SecurityTxt

type SecurityTxt struct {
}

type ServerMediaRange

type ServerMediaRange struct {
	Type    string
	Subtype string
}

func (*ServerMediaRange) GetFullType

func (serverMediaRange *ServerMediaRange) GetFullType(normalize bool) string

func (*ServerMediaRange) GetStructuredSyntaxName

func (serverMediaRange *ServerMediaRange) GetStructuredSyntaxName(normalize bool) string

type StrictTransportSecurityPolicy

type StrictTransportSecurityPolicy struct {
	MaxAge            int
	IncludeSubdomains bool
	Preload           bool
	Raw               string
}

Jump to

Keyboard shortcuts

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