Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct {
IfMatch []string `header:"If-Match" doc:"Succeeds if the server's resource matches one of the passed values."`
IfNoneMatch []string `` /* 169-byte string literal not displayed */
IfModifiedSince time.Time `header:"If-Modified-Since" doc:"Succeeds if the server's resource date is more recent than the passed date."`
IfUnmodifiedSince time.Time `header:"If-Unmodified-Since" doc:"Succeeds if the server's resource date is older or the same as the passed date."`
// contains filtered or unexported fields
}
Params allow clients to send ETags or times to make a read or write conditional based on the state of the resource on the server, e.g. when it was last modified. This is useful for determining when a cache should be updated or to prevent multiple writers from overwriting each other's changes.
func (*Params) HasConditionalParams ¶
HasConditionalParams returns true if any conditional request headers have been set on the incoming request.
func (*Params) PreconditionFailed ¶
PreconditionFailed returns false if no conditional headers are present, or if the values passed fail based on the conditional read/write rules. See also: https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests. This method assumes there is some fast/efficient way to get a resource's current ETag and/or last-modified time before it is run.