Documentation ¶
Overview ¶
Package logstream provides functionality for saving and retrieving logs
Index ¶
- type LogEvent
- type Manager
- type MockManager
- func (_m *MockManager) ReadLogs(ctx context.Context, logStreamID string, startOffset int, limit int) ([]byte, error)
- func (_m *MockManager) Subscribe(ctx context.Context, options *SubscriptionOptions) (<-chan *LogEvent, error)
- func (_m *MockManager) WriteLogs(ctx context.Context, logStreamID string, startOffset int, buffer []byte) (*models.LogStream, error)
- type MockStore
- type Store
- type SubscriptionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { WriteLogs(ctx context.Context, logStreamID string, startOffset int, buffer []byte) (*models.LogStream, error) ReadLogs(ctx context.Context, logStreamID string, startOffset int, limit int) ([]byte, error) Subscribe(ctx context.Context, options *SubscriptionOptions) (<-chan *LogEvent, error) }
Manager interface encapsulates the logic for saving and retrieving logs
type MockManager ¶
MockManager is an autogenerated mock type for the Manager type
func NewMockManager ¶
func NewMockManager(t mockConstructorTestingTNewMockManager) *MockManager
NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockManager) ReadLogs ¶
func (_m *MockManager) ReadLogs(ctx context.Context, logStreamID string, startOffset int, limit int) ([]byte, error)
ReadLogs provides a mock function with given fields: ctx, logStreamID, startOffset, limit
func (*MockManager) Subscribe ¶
func (_m *MockManager) Subscribe(ctx context.Context, options *SubscriptionOptions) (<-chan *LogEvent, error)
Subscribe provides a mock function with given fields: ctx, options
type MockStore ¶
MockStore is an autogenerated mock type for the Store type
func NewMockStore ¶
func NewMockStore(t mockConstructorTestingTNewMockStore) *MockStore
NewMockStore creates a new instance of MockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type Store ¶
type Store interface { WriteLogs(ctx context.Context, logStreamID string, startOffset int, buffer []byte) error ReadLogs(ctx context.Context, logStreamID string, startOffset int, limit int) ([]byte, error) }
Store interface encapsulates the logic for saving and retrieving logs
func NewLogStore ¶
func NewLogStore(objectStore objectstore.ObjectStore, dbClient *db.Client) Store
NewLogStore creates an instance of the LogStore interface
type SubscriptionOptions ¶
SubscriptionOptions includes options for setting up a log event subscription