Documentation
¶
Overview ¶
Package eventhub is a generated GoMock package.
Package eventhub is a generated GoMock package.
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect()
- func (c *Client) CreateTopic(context.Context, string) error
- func (c *Client) DeleteTopic(context.Context, string) error
- func (c *Client) Health() datasource.Health
- func (c *Client) Publish(ctx context.Context, topic string, message []byte) error
- func (c *Client) Subscribe(ctx context.Context, topic string) (*pubsub.Message, error)
- func (c *Client) UseLogger(logger any)
- func (c *Client) UseMetrics(metrics any)
- func (c *Client) UseTracer(tracer any)
- type Config
- type Log
- type Logger
- type Message
- type Metrics
- type MockLogger
- func (m *MockLogger) Debug(args ...any)
- func (m *MockLogger) Debugf(pattern string, args ...any)
- func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
- func (m *MockLogger) Error(args ...any)
- func (m *MockLogger) Errorf(pattern string, args ...any)
- func (m *MockLogger) Fatal(args ...any)
- func (m *MockLogger) Log(args ...any)
- func (m *MockLogger) Logf(pattern string, args ...any)
- type MockLoggerMockRecorder
- func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Fatal(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Log(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Logf(pattern any, args ...any) *gomock.Call
- type MockMetrics
- type MockMetricsMockRecorder
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoMsgReceived = errors.New("no message received") ErrTopicMismatch = errors.New("topic should be same as Event Hub name") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Connect ¶
func (c *Client) Connect()
Connect establishes a connection to Cassandra and registers metrics using the provided configuration when the client was Created.
func (*Client) Health ¶
func (c *Client) Health() datasource.Health
func (*Client) Subscribe ¶
Subscribe checks all partitions for the first available event and returns it.
func (*Client) UseMetrics ¶
UseMetrics sets the metrics for the Event Hub client.
type Config ¶
type Config struct { ConnectionString string ContainerConnectionString string StorageServiceURL string StorageContainerName string EventhubName string // if not provided, it will read from the $Default consumergroup. ConsumerGroup string // the following configs are for advance setup of the Event Hub. StorageOptions *container.ClientOptions BlobStoreOptions *checkpoints.BlobStoreOptions ConsumerOptions *azeventhubs.ConsumerClientOptions ProducerOptions *azeventhubs.ProducerClientOptions }
type Log ¶
type Log struct { Mode string `json:"mode"` MessageValue string `json:"messageValue"` Topic string `json:"topic"` Host string `json:"host"` PubSubBackend string `json:"pubSubBackend"` Time int64 `json:"time"` }
func (*Log) PrettyPrint ¶
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(pattern string, args ...interface{}) Log(args ...interface{}) Logf(pattern string, args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Errorf(pattern string, args ...interface{}) }
Logger interface with required methods.
type MockLogger ¶
type MockLogger struct {
// contains filtered or unexported fields
}
MockLogger is a mock of Logger interface.
func NewMockLogger ¶
func NewMockLogger(ctrl *gomock.Controller) *MockLogger
NewMockLogger creates a new mock instance.
func (*MockLogger) Debugf ¶
func (m *MockLogger) Debugf(pattern string, args ...any)
Debugf mocks base method.
func (*MockLogger) EXPECT ¶
func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLogger) Errorf ¶
func (m *MockLogger) Errorf(pattern string, args ...any)
Errorf mocks base method.
func (*MockLogger) Logf ¶
func (m *MockLogger) Logf(pattern string, args ...any)
Logf mocks base method.
type MockLoggerMockRecorder ¶
type MockLoggerMockRecorder struct {
// contains filtered or unexported fields
}
MockLoggerMockRecorder is the mock recorder for MockLogger.
func (*MockLoggerMockRecorder) Debug ¶
func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
Debug indicates an expected call of Debug.
func (*MockLoggerMockRecorder) Debugf ¶
func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
Debugf indicates an expected call of Debugf.
func (*MockLoggerMockRecorder) Error ¶
func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
Error indicates an expected call of Error.
func (*MockLoggerMockRecorder) Errorf ¶
func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call
Errorf indicates an expected call of Errorf.
func (*MockLoggerMockRecorder) Fatal ¶
func (mr *MockLoggerMockRecorder) Fatal(args ...any) *gomock.Call
Fatal indicates an expected call of Fatal.
type MockMetrics ¶
type MockMetrics struct {
// contains filtered or unexported fields
}
MockMetrics is a mock of Metrics interface.
func NewMockMetrics ¶
func NewMockMetrics(ctrl *gomock.Controller) *MockMetrics
NewMockMetrics creates a new mock instance.
func (*MockMetrics) EXPECT ¶
func (m *MockMetrics) EXPECT() *MockMetricsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetrics) IncrementCounter ¶
func (m *MockMetrics) IncrementCounter(ctx context.Context, name string, labels ...string)
IncrementCounter mocks base method.
type MockMetricsMockRecorder ¶
type MockMetricsMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsMockRecorder is the mock recorder for MockMetrics.
func (*MockMetricsMockRecorder) IncrementCounter ¶
func (mr *MockMetricsMockRecorder) IncrementCounter(ctx, name any, labels ...any) *gomock.Call
IncrementCounter indicates an expected call of IncrementCounter.