Versions in this module Expand all Collapse all v0 v0.2.0 Apr 15, 2023 Changes in this version type RequestCacheDirectives + StaleIfError DeltaSeconds v0.1.0 Apr 1, 2021 Changes in this version + var ErrImmutableNoArgs = errors.New("Unexpected argument to `immutable`") + var ErrMaxAgeDeltaSeconds = errors.New("Failed to parse delta-seconds in `max-age`") + var ErrMaxStaleDeltaSeconds = errors.New("Failed to parse delta-seconds in `max-stale`") + var ErrMinFreshDeltaSeconds = errors.New("Failed to parse delta-seconds in `min-fresh`") + var ErrMustRevalidateNoArgs = errors.New("Unexpected argument to `must-revalidate`") + var ErrNoCacheNoArgs = errors.New("Unexpected argument to `no-cache`") + var ErrNoStoreNoArgs = errors.New("Unexpected argument to `no-store`") + var ErrNoTransformNoArgs = errors.New("Unexpected argument to `no-transform`") + var ErrOnlyIfCachedNoArgs = errors.New("Unexpected argument to `only-if-cached`") + var ErrProxyRevalidateNoArgs = errors.New("Unexpected argument to `proxy-revalidate`") + var ErrPublicNoArgs = errors.New("Unexpected argument to `public`") + var ErrQuoteMismatch = errors.New("Missing closing quote") + var ErrSMaxAgeDeltaSeconds = errors.New("Failed to parse delta-seconds in `s-maxage`") + var ErrStaleIfErrorDeltaSeconds = errors.New("Failed to parse delta-seconds in `stale-if-error`") + var ErrStaleWhileRevalidateDeltaSeconds = errors.New("Failed to parse delta-seconds in `stale-while-revalidate`") + func CachableObject(obj *Object, rv *ObjectResults) + func CachableRequestObject(obj *Object, rv *ObjectResults) + func CachableResponseObject(obj *Object, rv *ObjectResults) + func ExpirationObject(obj *Object, rv *ObjectResults) + func UsingRequestResponseWithObject(req *http.Request, statusCode int, respHeaders http.Header, privateCache bool) ([]Reason, time.Time, []Warning, *Object, error) + type DeltaSeconds int32 + type FieldNames map[string]bool + type Object struct + CacheIsPrivate bool + NowUTC time.Time + ReqDirectives *RequestCacheDirectives + ReqHeaders http.Header + ReqMethod string + RespDateHeader time.Time + RespDirectives *ResponseCacheDirectives + RespExpiresHeader time.Time + RespHeaders http.Header + RespLastModifiedHeader time.Time + RespStatusCode int + type ObjectResults struct + OutErr error + OutExpirationTime time.Time + OutReasons []Reason + OutWarnings []Warning + type Reason int + const ReasonRequestAuthorizationHeader + const ReasonRequestMethodCONNECT + const ReasonRequestMethodDELETE + const ReasonRequestMethodOPTIONS + const ReasonRequestMethodPOST + const ReasonRequestMethodPUT + const ReasonRequestMethodTRACE + const ReasonRequestMethodUnknown + const ReasonRequestNoStore + const ReasonResponseNoStore + const ReasonResponsePrivate + const ReasonResponseUncachableByDefault + func UsingRequestResponse(req *http.Request, statusCode int, respHeaders http.Header, privateCache bool) ([]Reason, time.Time, error) + func (r Reason) String() string + type RequestCacheDirectives struct + Extensions []string + MaxAge DeltaSeconds + MaxStale DeltaSeconds + MaxStaleSet bool + MinFresh DeltaSeconds + NoCache bool + NoStore bool + NoTransform bool + OnlyIfCached bool + func ParseRequestCacheControl(value string) (*RequestCacheDirectives, error) + type ResponseCacheDirectives struct + Extensions []string + Immutable bool + MaxAge DeltaSeconds + MustRevalidate bool + NoCache FieldNames + NoCachePresent bool + NoStore bool + NoTransform bool + Private FieldNames + PrivatePresent bool + ProxyRevalidate bool + Public bool + SMaxAge DeltaSeconds + StaleIfError DeltaSeconds + StaleWhileRevalidate DeltaSeconds + func ParseResponseCacheControl(value string) (*ResponseCacheDirectives, error) + type Warning int + const WarningDisconnectedOperation + const WarningHeuristicExpiration + const WarningMiscellaneousPersistentWarning + const WarningMiscellaneousWarning + const WarningResponseIsStale + const WarningRevalidationFailed + const WarningTransformationApplied + func (w Warning) HeaderString(agent string, date time.Time) string + func (w Warning) String() string