snapshot

package
v0.0.0-...-da8027b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package snapshot is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrCodecNotFound = errors.New("snapshot: codec not found")
View Source
var ErrNoSnapshot = errors.New("snapshot: no snapshot")

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Decode(ctx context.Context, st stream.Type, stream []byte) (stream.Stream, error)
	Encode(ctx context.Context, s stream.Stream) ([]byte, error)
}

type Collector

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

func (*Collector) Load

func (s *Collector) Load(ctx context.Context, sid stream.ID, st stream.Type) (stream stream.Stream, err error)

func (*Collector) Remove

func (s *Collector) Remove(ctx context.Context, st stream.Type, sid stream.ID) (err error)

func (*Collector) Reset

func (s *Collector) Reset(ctx context.Context, st stream.Type) (err error)

func (*Collector) Should

func (s *Collector) Should(ctx context.Context, es stream.Stream) (ok bool)

func (*Collector) Take

func (s *Collector) Take(ctx context.Context, es stream.Stream) (err error)

type DecodeFunc

type DecodeFunc func(ctx context.Context, b []byte) (s stream.Stream, err error)

type DefaultCodec

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

func NewCodec

func NewCodec() *DefaultCodec

func (*DefaultCodec) Decode

func (e *DefaultCodec) Decode(ctx context.Context, st stream.Type, stream []byte) (stream.Stream, error)

func (*DefaultCodec) Encode

func (e *DefaultCodec) Encode(ctx context.Context, s stream.Stream) ([]byte, error)

func (*DefaultCodec) Stream

func (e *DefaultCodec) Stream(st stream.Type, enc EncodeFunc, dec DecodeFunc)

type EncodeFunc

type EncodeFunc func(ctx context.Context, s stream.Stream) (b []byte, err error)

type Logging

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

func (*Logging) Load

func (l *Logging) Load(ctx context.Context, sid stream.ID, st stream.Type) (s stream.Stream, err error)

func (*Logging) Remove

func (l *Logging) Remove(ctx context.Context, st stream.Type, sid stream.ID) (err error)

func (*Logging) Reset

func (l *Logging) Reset(ctx context.Context, st stream.Type) (err error)

func (*Logging) Should

func (l *Logging) Should(ctx context.Context, s stream.Stream) (ok bool)

func (*Logging) Take

func (l *Logging) Take(ctx context.Context, s stream.Stream) (err error)

type Metrics

type Metrics struct {
	LoadCounter   metrics.Counter
	LoadHistogram metrics.Histogram

	TakeCounter   metrics.Counter
	TakeHistogram metrics.Histogram

	ShouldCounter metrics.Counter

	ResetCounter   metrics.Counter
	ResetHistogram metrics.Histogram

	RemoveCounter   metrics.Counter
	RemoveHistogram metrics.Histogram
}

type Middleware

type Middleware func(Snapshot) Snapshot

func NewCollector

func NewCollector(m *Metrics) Middleware

func NewLogging

func NewLogging(logger log.Logger) Middleware

func Wrap

func Wrap(em Middleware, ems ...Middleware) Middleware

type MockSnapshot

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

MockSnapshot is a mock of Snapshot interface

func NewMockSnapshot

func NewMockSnapshot(ctrl *gomock.Controller) *MockSnapshot

NewMockSnapshot creates a new mock instance

func (*MockSnapshot) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockSnapshot) Load

func (m *MockSnapshot) Load(ctx context.Context, sid stream.ID, st stream.Type) (stream.Stream, error)

Load mocks base method

func (*MockSnapshot) Remove

func (m *MockSnapshot) Remove(ctx context.Context, st stream.Type, sid stream.ID) error

Remove mocks base method

func (*MockSnapshot) Reset

func (m *MockSnapshot) Reset(ctx context.Context, st stream.Type) error

Reset mocks base method

func (*MockSnapshot) Should

func (m *MockSnapshot) Should(ctx context.Context, s stream.Stream) bool

Should mocks base method

func (*MockSnapshot) Take

func (m *MockSnapshot) Take(ctx context.Context, s stream.Stream) error

Take mocks base method

type MockSnapshotMockRecorder

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

MockSnapshotMockRecorder is the mock recorder for MockSnapshot

func (*MockSnapshotMockRecorder) Load

func (mr *MockSnapshotMockRecorder) Load(ctx, sid, st interface{}) *gomock.Call

Load indicates an expected call of Load

func (*MockSnapshotMockRecorder) Remove

func (mr *MockSnapshotMockRecorder) Remove(ctx, st, sid interface{}) *gomock.Call

Remove indicates an expected call of Remove

func (*MockSnapshotMockRecorder) Reset

func (mr *MockSnapshotMockRecorder) Reset(ctx, st interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockSnapshotMockRecorder) Should

func (mr *MockSnapshotMockRecorder) Should(ctx, s interface{}) *gomock.Call

Should indicates an expected call of Should

func (*MockSnapshotMockRecorder) Take

func (mr *MockSnapshotMockRecorder) Take(ctx, s interface{}) *gomock.Call

Take indicates an expected call of Take

Jump to

Keyboard shortcuts

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