cache

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now

Functions

This section is empty.

Types

type Cache

type Cache struct {
	TimeToLiveMs int
	Location     string
	// contains filtered or unexported fields
}

func (*Cache) Combine added in v0.2.2

func (c *Cache) Combine(location string, selectors []byte, name string) (uint64, error)

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, selectors []byte, viewName string) (*Entry, error)

func (*Cache) Init

func (c *Cache) Init(ctx context.Context) error

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, entry *Entry, response []byte, compressionType string, headers http.Header) error

type Entry

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

func (*Entry) Close added in v0.2.2

func (e *Entry) Close() error

func (*Entry) CompressionType added in v0.2.2

func (e *Entry) CompressionType() string

func (*Entry) Has added in v0.2.2

func (e *Entry) Has() bool

func (*Entry) Headers added in v0.2.11

func (e *Entry) Headers() http.Header

func (*Entry) Read added in v0.2.2

func (e *Entry) Read(p []byte) (int, error)

func (*Entry) Reader added in v0.2.2

func (e *Entry) Reader() (io.Reader, bool)

func (*Entry) Size added in v0.2.2

func (e *Entry) Size() int

type LineReadCloser added in v0.2.2

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

func (*LineReadCloser) ReadLine added in v0.2.2

func (c *LineReadCloser) ReadLine() ([]byte, error)

type Meta added in v0.2.2

type Meta struct {
	View            string
	Selectors       []byte
	ExpireAt        time.Time
	Size            int
	CompressionType string
	ExtraHeaders    http.Header
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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