cache

package
v0.0.0-...-cdef871 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEnvelopeCacheMaxSize = int64(1024 * 1024 * 1024)
)

Functions

This section is empty.

Types

type EnvelopeCacheEntry

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

type EnvelopeCacheEntryFragment

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

type EnvelopeStorage

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

EnvelopeStorage implements a cache layer on top of a storage.EnvelopeStorage The cache is populated during store, NOT during read. As such it is optimized for a write followed by consecutive reads on the same instance, which should cover most the needs until we do actual load-balancing

func NewEnvelopeStorage

func NewEnvelopeStorage(backend storage.EnvelopeStorage, maxsize int64, log zerolog.Logger) *EnvelopeStorage

NewEnvelopeStorage creates a cached envelope storage.

func (*EnvelopeStorage) CheckStalled

func (s *EnvelopeStorage) CheckStalled(id api.UUID, duration time.Duration) bool

func (*EnvelopeStorage) GetEventTypes

func (s *EnvelopeStorage) GetEventTypes(id api.UUID) (types []string, exists bool)

func (*EnvelopeStorage) Purge

func (s *EnvelopeStorage) Purge(filter storage.EnvelopeFilter)

func (*EnvelopeStorage) ReadEnvelope

func (s *EnvelopeStorage) ReadEnvelope(id api.UUID, position storage.EnvelopeReadPos, maxsize int) (api.Envelope, storage.EnvelopeReadPos, error)

func (*EnvelopeStorage) ReceptionStatus

func (*EnvelopeStorage) SetEventHandler

func (s *EnvelopeStorage) SetEventHandler(handler storage.EnvelopeStorageEventHandler)

func (*EnvelopeStorage) Stat

func (*EnvelopeStorage) StoreEnvelope

func (s *EnvelopeStorage) StoreEnvelope(envelope api.Envelope) (storage.EnvelopeState, error)

Jump to

Keyboard shortcuts

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