Documentation
¶
Overview ¶
Package api is a generated GoMock package.
Index ¶
- Constants
- Variables
- func Append(ctx context.Context, w BusWriter, events []*ce.Event, opts ...WriteOption) (eids []string, err error)
- func AppendOne(ctx context.Context, w BusWriter, event *ce.Event, opts ...WriteOption) (eid string, err error)
- func Read(ctx context.Context, r BusReader, opts ...ReadOption) (events []*ce.Event, off int64, logid uint64, err error)
- type BusReader
- type BusWriter
- type ConsumeFromWhere
- type Eventbus
- type EventbusOption
- type EventbusOptions
- type Eventlog
- type LogOption
- type LogOptions
- type LogPolicy
- type MockBusReader
- type MockBusReaderMockRecorder
- type MockBusWriter
- type MockBusWriterMockRecorder
- type MockEventbus
- func (m *MockEventbus) CheckHealth(ctx context.Context) error
- func (m *MockEventbus) Close(ctx context.Context)
- func (m *MockEventbus) EXPECT() *MockEventbusMockRecorder
- func (m *MockEventbus) GetLog(ctx context.Context, logID uint64, opts ...LogOption) (Eventlog, error)
- func (m *MockEventbus) ListLog(ctx context.Context, opts ...LogOption) ([]Eventlog, error)
- func (m *MockEventbus) Reader(opts ...ReadOption) BusReader
- func (m *MockEventbus) Writer(opts ...WriteOption) BusWriter
- type MockEventbusMockRecorder
- func (mr *MockEventbusMockRecorder) CheckHealth(ctx interface{}) *gomock.Call
- func (mr *MockEventbusMockRecorder) Close(ctx interface{}) *gomock.Call
- func (mr *MockEventbusMockRecorder) GetLog(ctx, logID interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEventbusMockRecorder) ListLog(ctx interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEventbusMockRecorder) Reader(opts ...interface{}) *gomock.Call
- func (mr *MockEventbusMockRecorder) Writer(opts ...interface{}) *gomock.Call
- type MockEventlog
- func (m *MockEventlog) CheckHealth(ctx context.Context) error
- func (m *MockEventlog) EXPECT() *MockEventlogMockRecorder
- func (m *MockEventlog) EarliestOffset(ctx context.Context) (int64, error)
- func (m *MockEventlog) ID() uint64
- func (m *MockEventlog) LatestOffset(ctx context.Context) (int64, error)
- func (m *MockEventlog) Length(ctx context.Context) (int64, error)
- func (m *MockEventlog) QueryOffsetByTime(ctx context.Context, timestamp int64) (int64, error)
- type MockEventlogMockRecorder
- func (mr *MockEventlogMockRecorder) CheckHealth(ctx interface{}) *gomock.Call
- func (mr *MockEventlogMockRecorder) EarliestOffset(ctx interface{}) *gomock.Call
- func (mr *MockEventlogMockRecorder) ID() *gomock.Call
- func (mr *MockEventlogMockRecorder) LatestOffset(ctx interface{}) *gomock.Call
- func (mr *MockEventlogMockRecorder) Length(ctx interface{}) *gomock.Call
- func (mr *MockEventlogMockRecorder) QueryOffsetByTime(ctx, timestamp interface{}) *gomock.Call
- type PolicyType
- type ReadOption
- type ReadOptions
- type ReadPolicy
- type WriteOption
- type WriteOptions
- type WritePolicy
Constants ¶
const ( RoundRobin = PolicyType("round_robin") Manually = PolicyType("manually") Weight = PolicyType("weight") ReadOnly = PolicyType("readonly") ReadWrite = PolicyType("readwrite") )
const (
DefaultPollingTimeout = 3000 // in milliseconds.
)
Variables ¶
var ( ConsumeFromWhereEarliest = ConsumeFromWhere("earliest") ConsumeFromWhereLatest = ConsumeFromWhere("latest") )
Functions ¶
Types ¶
type BusReader ¶
type BusReader interface {
Read(ctx context.Context, opts ...ReadOption) (events *cloudevents.CloudEventBatch, off int64, logid uint64, err error)
}
type BusWriter ¶
type BusWriter interface {
Append(ctx context.Context, events *cloudevents.CloudEventBatch, opts ...WriteOption) (eids []string, err error)
}
type ConsumeFromWhere ¶
type ConsumeFromWhere string
type Eventbus ¶
type Eventbus interface { Writer(opts ...WriteOption) BusWriter Reader(opts ...ReadOption) BusReader GetLog(ctx context.Context, logID uint64, opts ...LogOption) (Eventlog, error) ListLog(ctx context.Context, opts ...LogOption) ([]Eventlog, error) CheckHealth(ctx context.Context) error Close(ctx context.Context) }
type EventbusOption ¶
type EventbusOption func(opt *EventbusOptions)
func WithID ¶
func WithID(id uint64) EventbusOption
func WithName ¶
func WithName(name string) EventbusOption
type EventbusOptions ¶
func DefaultEventbusOptions ¶
func DefaultEventbusOptions() *EventbusOptions
type LogOption ¶
type LogOption func(*LogOptions)
type LogOptions ¶
type LogOptions struct {
Policy LogPolicy
}
type LogPolicy ¶
type LogPolicy interface {
AccessMode() PolicyType
}
type MockBusReader ¶
type MockBusReader struct {
// contains filtered or unexported fields
}
MockBusReader is a mock of BusReader interface.
func NewMockBusReader ¶
func NewMockBusReader(ctrl *gomock.Controller) *MockBusReader
NewMockBusReader creates a new mock instance.
func (*MockBusReader) EXPECT ¶
func (m *MockBusReader) EXPECT() *MockBusReaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBusReader) Read ¶
func (m *MockBusReader) Read(ctx context.Context, opts ...ReadOption) (*cloudevents.CloudEventBatch, int64, uint64, error)
Read mocks base method.
type MockBusReaderMockRecorder ¶
type MockBusReaderMockRecorder struct {
// contains filtered or unexported fields
}
MockBusReaderMockRecorder is the mock recorder for MockBusReader.
func (*MockBusReaderMockRecorder) Read ¶
func (mr *MockBusReaderMockRecorder) Read(ctx interface{}, opts ...interface{}) *gomock.Call
Read indicates an expected call of Read.
type MockBusWriter ¶
type MockBusWriter struct {
// contains filtered or unexported fields
}
MockBusWriter is a mock of BusWriter interface.
func NewMockBusWriter ¶
func NewMockBusWriter(ctrl *gomock.Controller) *MockBusWriter
NewMockBusWriter creates a new mock instance.
func (*MockBusWriter) Append ¶
func (m *MockBusWriter) Append(ctx context.Context, events *cloudevents.CloudEventBatch, opts ...WriteOption) ([]string, error)
Append mocks base method.
func (*MockBusWriter) EXPECT ¶
func (m *MockBusWriter) EXPECT() *MockBusWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBusWriterMockRecorder ¶
type MockBusWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockBusWriterMockRecorder is the mock recorder for MockBusWriter.
func (*MockBusWriterMockRecorder) Append ¶
func (mr *MockBusWriterMockRecorder) Append(ctx, events interface{}, opts ...interface{}) *gomock.Call
Append indicates an expected call of Append.
type MockEventbus ¶
type MockEventbus struct {
// contains filtered or unexported fields
}
MockEventbus is a mock of Eventbus interface.
func NewMockEventbus ¶
func NewMockEventbus(ctrl *gomock.Controller) *MockEventbus
NewMockEventbus creates a new mock instance.
func (*MockEventbus) CheckHealth ¶ added in v0.9.0
func (m *MockEventbus) CheckHealth(ctx context.Context) error
CheckHealth mocks base method.
func (*MockEventbus) Close ¶
func (m *MockEventbus) Close(ctx context.Context)
Close mocks base method.
func (*MockEventbus) EXPECT ¶
func (m *MockEventbus) EXPECT() *MockEventbusMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEventbus) GetLog ¶
func (m *MockEventbus) GetLog(ctx context.Context, logID uint64, opts ...LogOption) (Eventlog, error)
GetLog mocks base method.
func (*MockEventbus) Reader ¶
func (m *MockEventbus) Reader(opts ...ReadOption) BusReader
Reader mocks base method.
func (*MockEventbus) Writer ¶
func (m *MockEventbus) Writer(opts ...WriteOption) BusWriter
Writer mocks base method.
type MockEventbusMockRecorder ¶
type MockEventbusMockRecorder struct {
// contains filtered or unexported fields
}
MockEventbusMockRecorder is the mock recorder for MockEventbus.
func (*MockEventbusMockRecorder) CheckHealth ¶ added in v0.9.0
func (mr *MockEventbusMockRecorder) CheckHealth(ctx interface{}) *gomock.Call
CheckHealth indicates an expected call of CheckHealth.
func (*MockEventbusMockRecorder) Close ¶
func (mr *MockEventbusMockRecorder) Close(ctx interface{}) *gomock.Call
Close indicates an expected call of Close.
func (*MockEventbusMockRecorder) GetLog ¶
func (mr *MockEventbusMockRecorder) GetLog(ctx, logID interface{}, opts ...interface{}) *gomock.Call
GetLog indicates an expected call of GetLog.
func (*MockEventbusMockRecorder) ListLog ¶
func (mr *MockEventbusMockRecorder) ListLog(ctx interface{}, opts ...interface{}) *gomock.Call
ListLog indicates an expected call of ListLog.
func (*MockEventbusMockRecorder) Reader ¶
func (mr *MockEventbusMockRecorder) Reader(opts ...interface{}) *gomock.Call
Reader indicates an expected call of Reader.
func (*MockEventbusMockRecorder) Writer ¶
func (mr *MockEventbusMockRecorder) Writer(opts ...interface{}) *gomock.Call
Writer indicates an expected call of Writer.
type MockEventlog ¶
type MockEventlog struct {
// contains filtered or unexported fields
}
MockEventlog is a mock of Eventlog interface.
func NewMockEventlog ¶
func NewMockEventlog(ctrl *gomock.Controller) *MockEventlog
NewMockEventlog creates a new mock instance.
func (*MockEventlog) CheckHealth ¶ added in v0.9.0
func (m *MockEventlog) CheckHealth(ctx context.Context) error
CheckHealth mocks base method.
func (*MockEventlog) EXPECT ¶
func (m *MockEventlog) EXPECT() *MockEventlogMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEventlog) EarliestOffset ¶
func (m *MockEventlog) EarliestOffset(ctx context.Context) (int64, error)
EarliestOffset mocks base method.
func (*MockEventlog) LatestOffset ¶
func (m *MockEventlog) LatestOffset(ctx context.Context) (int64, error)
LatestOffset mocks base method.
func (*MockEventlog) Length ¶
func (m *MockEventlog) Length(ctx context.Context) (int64, error)
Length mocks base method.
func (*MockEventlog) QueryOffsetByTime ¶
QueryOffsetByTime mocks base method.
type MockEventlogMockRecorder ¶
type MockEventlogMockRecorder struct {
// contains filtered or unexported fields
}
MockEventlogMockRecorder is the mock recorder for MockEventlog.
func (*MockEventlogMockRecorder) CheckHealth ¶ added in v0.9.0
func (mr *MockEventlogMockRecorder) CheckHealth(ctx interface{}) *gomock.Call
CheckHealth indicates an expected call of CheckHealth.
func (*MockEventlogMockRecorder) EarliestOffset ¶
func (mr *MockEventlogMockRecorder) EarliestOffset(ctx interface{}) *gomock.Call
EarliestOffset indicates an expected call of EarliestOffset.
func (*MockEventlogMockRecorder) ID ¶
func (mr *MockEventlogMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockEventlogMockRecorder) LatestOffset ¶
func (mr *MockEventlogMockRecorder) LatestOffset(ctx interface{}) *gomock.Call
LatestOffset indicates an expected call of LatestOffset.
func (*MockEventlogMockRecorder) Length ¶
func (mr *MockEventlogMockRecorder) Length(ctx interface{}) *gomock.Call
Length indicates an expected call of Length.
func (*MockEventlogMockRecorder) QueryOffsetByTime ¶
func (mr *MockEventlogMockRecorder) QueryOffsetByTime(ctx, timestamp interface{}) *gomock.Call
QueryOffsetByTime indicates an expected call of QueryOffsetByTime.
type PolicyType ¶
type PolicyType string
type ReadOption ¶
type ReadOption func(*ReadOptions)
type ReadOptions ¶
type ReadOptions struct { BatchSize int PollingTimeout int64 Policy ReadPolicy }
func (*ReadOptions) Apply ¶
func (ro *ReadOptions) Apply(opts ...ReadOption)
func (*ReadOptions) Copy ¶
func (ro *ReadOptions) Copy() *ReadOptions
type ReadPolicy ¶
type ReadPolicy interface { WritePolicy Offset() int64 Forward(diff int) }
type WriteOption ¶
type WriteOption func(*WriteOptions)
type WriteOptions ¶
type WriteOptions struct { Policy WritePolicy Oneway bool }
func (*WriteOptions) Apply ¶
func (wo *WriteOptions) Apply(opts ...WriteOption)
func (*WriteOptions) Copy ¶
func (wo *WriteOptions) Copy() *WriteOptions
type WritePolicy ¶
type WritePolicy interface { Type() PolicyType NextLog(ctx context.Context) (Eventlog, error) }