cache

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (
	AddPartition = iota
	RemovePartition
	ClearPartition
)

Variables

This section is empty.

Functions

func Add

func Add(topic string) (err error)

func Append

func Append(topic, partition string, entries Entries) (err error)

func Build

func Build(dataDir string)

func Catalog

func Catalog() map[string]map[string]int

func Fill

func Fill() error

func GetAll

func GetAll(topic string, from, to *time.Time, last int) map[string]Entries

func Pull

func Pull() <-chan interface{}

func PullAdditions

func PullAdditions() <-chan *Publication

func PullRemovals

func PullRemovals() <-chan *Publication

func Remove

func Remove(topic string)

func Size

func Size() (size int)

TODO: implement cache size calculation

func Trim

func Trim()

func Update

func Update(topic, partition string, action int) (err error)

Types

type Cache

type Cache struct {
	LastCommit CacheCommit
	// contains filtered or unexported fields
}

type CacheCommit

type CacheCommit struct {
	Timestamp time.Time
	Key       string
}

func LastCommit

func LastCommit() CacheCommit

type Entries

type Entries []*Entry

func GenData

func GenData() (e Entries)

func Get

func Get(topic, key string, from, to *time.Time, last int) (entries Entries)

func (Entries) Len

func (e Entries) Len() int

func (Entries) Less

func (e Entries) Less(i, j int) bool

func (Entries) Swap

func (e Entries) Swap(i, j int)

type Entry

type Entry struct {
	Timestamp time.Time
	Data      json.RawMessage
}

type Partition

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

type Publication

type Publication struct {
	Topic     string
	Partition string
	Entries   Entries
}

type Router

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

func (*Router) Add

func (r *Router) Add(topic string)

func (*Router) Publish

func (r *Router) Publish(topic, partition string, entries Entries)

func (*Router) Remove

func (r *Router) Remove(topic string)

func (*Router) Update

func (r *Router) Update(topic, partition string, action int) error

type Topic

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

Jump to

Keyboard shortcuts

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