Documentation
¶
Index ¶
- Variables
- type Accept
- type AcceptEncoding
- type AcceptLanguage
- type Authorization
- type CacheControl
- func (cacheControl *CacheControl) MaxAge() (int, error)
- func (cacheControl *CacheControl) MaxStale() (int, bool, error)
- func (cacheControl *CacheControl) MinFresh() (int, error)
- func (cacheControl *CacheControl) MustRevalidate() bool
- func (cacheControl *CacheControl) MustUnderstand() bool
- func (cacheControl *CacheControl) NoCache() bool
- func (cacheControl *CacheControl) NoCacheFieldNames() []string
- func (cacheControl *CacheControl) NoStore() bool
- func (cacheControl *CacheControl) NoTransform() bool
- func (cacheControl *CacheControl) OnlyIfCached() bool
- func (cacheControl *CacheControl) Private() bool
- func (cacheControl *CacheControl) PrivateFieldNames() []string
- func (cacheControl *CacheControl) ProxyRevalidate() bool
- func (cacheControl *CacheControl) Public() bool
- func (cacheControl *CacheControl) SMaxAge() (int, error)
- func (cacheControl *CacheControl) SetVisibility(public bool)
- func (cacheControl *CacheControl) String() string
- type CacheControlDirective
- type ContentDisposition
- type ContentNegotiation
- type ContentType
- type CorsConfiguration
- type ETag
- type Encoding
- type Forwarded
- type ForwardedElement
- type HttpContext
- type LanguageQ
- type LanguageTag
- type MediaRange
- type MediaType
- type RetryAfter
- type RobotsTxt
- type RobotsTxtGroup
- type SecurityTxt
- type ServerMediaRange
- type StrictTransportSecurityPolicy
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (*AcceptEncoding) GetPriorityOrderedEncodings ¶
func (acceptEncoding *AcceptEncoding) GetPriorityOrderedEncodings() []*Encoding
type AcceptLanguage ¶
func (*AcceptLanguage) GetPriorityOrderedLanguages ¶
func (acceptLanguage *AcceptLanguage) GetPriorityOrderedLanguages() []*LanguageQ
type Authorization ¶
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) 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)
func (*CacheControl) SetVisibility ¶ added in v1.33.0
func (cacheControl *CacheControl) SetVisibility(public bool)
SetVisibility makes the header say `public` or `private` and not the other, leaving every other directive where it was. Neither is added to a header that states neither -- a response that says nothing about who may store it is left saying nothing, rather than being given an answer it did not have.
func (*CacheControl) String ¶ added in v1.33.0
func (cacheControl *CacheControl) String() string
String writes the header back out from the directives, so that a parsed header can be changed and re-sent rather than patched as a string. It is not Raw: a header that has been altered no longer is what it was received as, and one built from directives was never received at all.
Directives keep the order they were parsed in, which is the order a reader would have seen them.
type CacheControlDirective ¶
func (*CacheControlDirective) String ¶ added in v1.33.0
func (directive *CacheControlDirective) String() string
String writes the directive back out. A value that is a bare token is written as it is; anything else is quoted, which is the only form the grammar allows it to take.
type ContentDisposition ¶
type ContentNegotiation ¶
type ContentNegotiation struct {
Accept *Accept
AcceptEncoding *AcceptEncoding
AcceptLanguage *AcceptLanguage
NegotiatedAccept string
NegotiatedAcceptEncoding string
}
type ContentType ¶
type ContentType struct {
MediaType
}
type CorsConfiguration ¶
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 *altshiftTlsTypes.TlsContext
User *schema.User
Extra []*HttpContext
LocalAddr net.Addr
RemoteAddr net.Addr
}
type LanguageQ ¶
type LanguageQ struct {
Tag *LanguageTag
Q float32
}
type LanguageTag ¶
type MediaRange ¶
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 ¶
func (*MediaType) GetFullType ¶
func (*MediaType) GetParametersMap ¶
func (*MediaType) GetStructuredSyntaxName ¶
type RetryAfter ¶
type RobotsTxt ¶
type RobotsTxt struct {
Groups []*RobotsTxtGroup
}
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 {
// Contacts are where a vulnerability is reported, most preferred first, each as a URI:
// "mailto:security@example.com", "https://example.com/vulnerability", "tel:+46-...". RFC 9116
// requires at least one; a security.txt without one says nothing and renders as empty.
Contacts []string
// Expires is when the information stops being considered valid. RFC 9116 requires it, and a
// reporter is to disregard the file once it has passed.
Expires time.Time
// Encryption are keys a report may be encrypted with, each as a URI. RFC 9116 forbids naming a
// key by its fingerprint here; it is to be fetched from where this points.
Encryption []string
// Acknowledgments are where those who have reported are credited.
Acknowledgments []string
// PreferredLanguages are the languages a report is preferably written in, as RFC 5646 tags. The
// order carries no preference, RFC 9116 notwithstanding the field's name.
PreferredLanguages []string
// Canonical are the URIs this security.txt is expected to be found at, so that a copy found
// elsewhere can be told from the genuine one.
Canonical []string
// Policy are where the host's vulnerability disclosure policy is stated.
Policy []string
// Hiring are where the host advertises security-related work.
Hiring []string
// Csaf are where the host's CSAF provider metadata is served.
Csaf []string
}
SecurityTxt is what a host says about how a vulnerability in it is reported, served at /.well-known/security.txt (RFC 9116).
func (*SecurityTxt) String ¶
func (securityTxt *SecurityTxt) String() string
String renders the security.txt. It renders as empty unless a contact is named, there being nothing to say to a reporter without one.
type ServerMediaRange ¶
func (*ServerMediaRange) GetFullType ¶
func (serverMediaRange *ServerMediaRange) GetFullType(normalize bool) string
func (*ServerMediaRange) GetStructuredSyntaxName ¶
func (serverMediaRange *ServerMediaRange) GetStructuredSyntaxName(normalize bool) string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package js_error_report holds what a page's own JavaScript reports about the errors it ran into: the bodies of the reports it posts, as opposed to the ones a browser posts on its own through the Reporting API.
|
Package js_error_report holds what a page's own JavaScript reports about the errors it ran into: the bodies of the reports it posts, as opposed to the ones a browser posts on its own through the Reporting API. |