cache

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) 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) 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
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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