Documentation ¶
Overview ¶
Package solr is a generated GoMock package.
Package solr is a generated GoMock package.
Index ¶
- type Client
- func (c *Client) AddField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
- func (c *Client) Connect()
- func (c *Client) Create(ctx context.Context, collection string, document *bytes.Buffer, ...) (any, error)
- func (c *Client) Delete(ctx context.Context, collection string, document *bytes.Buffer, ...) (any, error)
- func (c *Client) DeleteField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
- func (c *Client) HealthCheck(ctx context.Context) (any, error)
- func (c *Client) ListFields(ctx context.Context, collection string, params map[string]any) (any, error)
- func (c *Client) Retrieve(ctx context.Context, collection string, params map[string]any) (any, error)
- func (c *Client) Search(ctx context.Context, collection string, params map[string]any) (any, error)
- func (c *Client) Update(ctx context.Context, collection string, document *bytes.Buffer, ...) (any, error)
- func (c *Client) UpdateField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
- func (c *Client) UseLogger(logger any)
- func (c *Client) UseMetrics(metrics any)
- func (c *Client) UseTracer(tracer any)
- type Config
- type Logger
- 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(patter string, args ...any)
- func (m *MockLogger) Info(args ...any)
- func (m *MockLogger) Infof(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(patter any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Info(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Infof(pattern any, args ...any) *gomock.Call
- type MockMetrics
- type MockMetricsMockRecorder
- type QueryLog
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New initializes Solr driver with the provided configuration. The Connect method must be called to establish a connection to Solr. Usage: client := New(config) client.UseLogger(loggerInstance) client.UseMetrics(metricsInstance) client.Connect().
func (*Client) AddField ¶
func (c *Client) AddField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
AddField adds Field in the schema for the specified collection.
func (*Client) Connect ¶
func (c *Client) Connect()
Connect establishes a connection to Solr and registers metrics using the provided configuration when the client was Created.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, collection string, document *bytes.Buffer, params map[string]any) (any, error)
Create makes documents in the specified collection. params can be used to send parameters like commit=true.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, collection string, document *bytes.Buffer, params map[string]any) (any, error)
Delete deletes documents in the specified collection. params can be used to send parameters like commit=true.
func (*Client) DeleteField ¶
func (c *Client) DeleteField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
DeleteField deletes the field definitions in the schema for the specified collection.
func (*Client) ListFields ¶
func (c *Client) ListFields(ctx context.Context, collection string, params map[string]any) (any, error)
ListFields retrieves all the fields in the schema for the specified collection. params can be used to send query parameters like wt, fl, includeDynamic etc.
func (*Client) Retrieve ¶
func (c *Client) Retrieve(ctx context.Context, collection string, params map[string]any) (any, error)
Retrieve retrieves the entire schema that includes all the fields,field types,dynamic rules and copy field rules. params can be used to specify the format of response.
func (*Client) Search ¶
Search searches documents in the given collections based on the parameters specified. This can be used for making any queries to Solr.
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, collection string, document *bytes.Buffer, params map[string]any) (any, error)
Update updates documents in the specified collection. params can be used to send parameters like commit=true.
func (*Client) UpdateField ¶
func (c *Client) UpdateField(ctx context.Context, collection string, document *bytes.Buffer) (any, error)
UpdateField updates the field definitions in the schema for the specified collection.
func (*Client) UseLogger ¶
UseLogger sets the logger for the Solr client which asserts the Logger interface.
func (*Client) UseMetrics ¶
UseMetrics sets the metrics for the Solr client which asserts the Metrics interface.
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(patter string, args ...any)
Errorf mocks base method.
func (*MockLogger) Infof ¶
func (m *MockLogger) Infof(pattern string, args ...any)
Infof 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(patter any, args ...any) *gomock.Call
Errorf indicates an expected call of Errorf.
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) NewHistogram ¶
func (m *MockMetrics) NewHistogram(name, desc string, buckets ...float64)
NewHistogram mocks base method.
func (*MockMetrics) RecordHistogram ¶
func (m *MockMetrics) RecordHistogram(ctx context.Context, name string, value float64, labels ...string)
RecordHistogram mocks base method.
type MockMetricsMockRecorder ¶
type MockMetricsMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsMockRecorder is the mock recorder for MockMetrics.
func (*MockMetricsMockRecorder) NewHistogram ¶
func (mr *MockMetricsMockRecorder) NewHistogram(name, desc any, buckets ...any) *gomock.Call
NewHistogram indicates an expected call of NewHistogram.
func (*MockMetricsMockRecorder) RecordHistogram ¶
func (mr *MockMetricsMockRecorder) RecordHistogram(ctx, name, value any, labels ...any) *gomock.Call
RecordHistogram indicates an expected call of RecordHistogram.