http

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Age

func Age(header http.Header, requestTime time.Time, responseTime time.Time) *int

Age based on RFC 9111

Types

type CacheControl

type CacheControl struct {
	// contains filtered or unexported fields
}

func ParseCacheControl

func ParseCacheControl(header http.Header, requestTime *time.Time, responseTime *time.Time, sharedCache bool, ttlFallback int) (cc CacheControl)

func (CacheControl) Cacheable

func (c CacheControl) Cacheable() bool

func (CacheControl) Expired

func (c CacheControl) Expired() bool

func (CacheControl) FreshnessLifetime

func (c CacheControl) FreshnessLifetime() int

func (CacheControl) MaxAge

func (c CacheControl) MaxAge() *int

func (CacheControl) MaxStale

func (c CacheControl) MaxStale() *int

func (CacheControl) MinFresh

func (c CacheControl) MinFresh() *int

func (CacheControl) MustRevalidate

func (c CacheControl) MustRevalidate() bool

func (CacheControl) MustUnderstand

func (c CacheControl) MustUnderstand() bool

func (CacheControl) NoCache

func (c CacheControl) NoCache() bool

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

func (CacheControl) ProxyRevalidate

func (c CacheControl) ProxyRevalidate() bool

func (CacheControl) Public

func (c CacheControl) Public() bool

func (CacheControl) SMaxAge

func (c CacheControl) SMaxAge() *int

type Config

type Config struct {
	DB              *sql.DB
	Tables          []string
	ReadOnly        bool
	CacheableStatus []int
	TTL             time.Duration
	RFC9111         bool
	SharedCache     bool
	CleanupInterval time.Duration
}

func (Config) Client

func (c Config) Client(ctx context.Context) (*http.Client, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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