cachecontrol

package module
v0.0.0-...-30341fe Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2014 License: MIT Imports: 5 Imported by: 62

README

cachecontrol

Package cachecontrol provides HTTP Cache-Control header parsing with some utility functions to quickly deal with directives values

Documentation

Overview

Package cachecontrol provides HTTP Cache-Control header parsing with some utility functions to quickly deal with directives values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheControl

type CacheControl map[string]string

CacheControl holds Cache-Control directives and gives a few utility methods to quickly deal with directives values

func Parse

func Parse(directive string) CacheControl

Parse parses the cache directive of a Cache-Control header and returns a CacheControl

func (CacheControl) MaxAge

func (c CacheControl) MaxAge() time.Duration

func (CacheControl) MaxStale

func (c CacheControl) MaxStale() time.Duration

MaxStale returns -1 if the directive wasn't present or if an error happened during parsing the value. It returns math.MaxInt64 if it was present but if no value was provided. Otherwise, it returns the provided duration

func (CacheControl) MinFresh

func (c CacheControl) MinFresh() time.Duration

func (CacheControl) MustRevalidate

func (c CacheControl) MustRevalidate() bool

func (CacheControl) NoCache

func (c CacheControl) NoCache() (bool, string)

func (CacheControl) NoStore

func (c CacheControl) NoStore() bool

func (CacheControl) NoTransform

func (c CacheControl) NoTransform() bool

func (CacheControl) OnlyIfCached

func (c CacheControl) OnlyIfCached() bool

func (CacheControl) Private

func (c CacheControl) Private() (bool, string)

func (CacheControl) ProxyRevalidate

func (c CacheControl) ProxyRevalidate() bool

func (CacheControl) Public

func (c CacheControl) Public() bool

Jump to

Keyboard shortcuts

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