cache

package
v0.0.0-...-b0c7cc0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CollectedObject      interface{} = ((*CollectedType)(nil))
	DefaultCachedTimeout             = time.Minute * 5
)

Functions

func Collect

func Collect(threshold int64, version uint64, root *tree.Tree, cache *Tree) int64

func SizeofBytes

func SizeofBytes(bytes []byte) int

func SizeofKey

func SizeofKey(key string) int

Types

type CollectedType

type CollectedType *struct{}

type Kind

type Kind int
const (
	KindNone Kind = iota
	KindPassby
	KindTimeout
	KindChildren
)

type Node

type Node interface {
	Kind() Kind
	Field(key string) Node
	Duration() time.Duration
}
var (
	NeverCached Node = ((*cacheNever)(nil))
)

type Tree

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

func Build

func Build(paths map[string]int64) (*Tree, error)

func (*Tree) Duration

func (t *Tree) Duration() time.Duration

func (*Tree) Field

func (t *Tree) Field(key string) Node

func (*Tree) Kind

func (*Tree) Kind() Kind

Jump to

Keyboard shortcuts

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