memory

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is an in-memory caching.Cache implementation.

func (*Cache) Delete

func (c *Cache) Delete(schema, typ string, key ...string)

Delete deletes a set of keys from the cache.

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, items ...*caching.Item)

Get implements caching.Cache.

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, exp time.Duration, items ...*caching.Item)

Put implements caching.Cache.

type Storage

type Storage struct {
	// MaxGetCount, if not zero, is the maximum number of records to retrieve from
	// a single Get request.
	MaxGetCount int

	// MaxLogAge is the configured maximum log age.
	MaxLogAge time.Duration
	// contains filtered or unexported fields
}

Storage is an implementation of the storage.Storage interface that stores data in memory.

This is intended for testing, and not intended to be performant.

func (*Storage) Close

func (s *Storage) Close()

Close implements storage.Storage.

func (*Storage) Config

func (s *Storage) Config(cfg storage.Config) error

Config implements storage.Storage.

func (*Storage) Count

func (s *Storage) Count(project cfgtypes.ProjectName, path types.StreamPath) (c int)

Count returns the number of log records for the given stream.

func (*Storage) Get

Get implements storage.Storage.

func (*Storage) Put

func (s *Storage) Put(req storage.PutRequest) error

Put implements storage.Storage.

func (*Storage) ResetClose

func (s *Storage) ResetClose()

ResetClose resets the storage instance, allowing it to be used another time. The data stored in this instance is not changed.

func (*Storage) SetErr

func (s *Storage) SetErr(err error)

SetErr sets the storage's error value. If not nil, all operations will fail with this error.

func (*Storage) Tail

func (s *Storage) Tail(project cfgtypes.ProjectName, path types.StreamPath) (*storage.Entry, error)

Tail implements storage.Storage.

Jump to

Keyboard shortcuts

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