mock_aerospike

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

README

Aerospike Mocks

Import path: github.com/InsideGallery/core/db/aerospike/mocks

This package contains generated GoMock support for tests that depend on the legacy Aerospike interfaces from github.com/InsideGallery/core/db/aerospike. The generated package name is mock_aerospike, so consumers usually import it with an alias.

Main APIs

  • NewMockAerospike(ctrl) creates a mock for the legacy aerospike.Aerospike interface.
  • NewMockNamespace(ctrl) creates a mock for the legacy aerospike.Namespace interface.
  • MockAerospike.EXPECT() and MockNamespace.EXPECT() return recorders for expected calls.
  • Generated expectations cover the SDK-shaped methods declared in interface.go, including record, batch, index, query, UDF, stats, truncate, and existence operations.

Usage

package example_test

import (
	"testing"

	mockaero "github.com/InsideGallery/core/db/aerospike/mocks"
	"github.com/golang/mock/gomock"
)

func TestUsesNamespace(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	namespace := mockaero.NewMockNamespace(ctrl)
	namespace.EXPECT().Exists(gomock.Any(), "users", "42").Return(true, nil)

	// Pass namespace to code that accepts aerospike.Namespace.
}

Operational Notes

This package is for tests only. Do not edit interface.go by hand; it is generated from db/aerospike/interface.go. For new code that depends on the core-owned NamespaceStore interface, a small local fake at the consumer boundary is usually simpler than using these legacy SDK-shaped mocks.

Documentation

Overview

Package mock_aerospike is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAerospike

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

MockAerospike is a mock of Aerospike interface.

func NewMockAerospike

func NewMockAerospike(ctrl *gomock.Controller) *MockAerospike

NewMockAerospike creates a new mock instance.

func (*MockAerospike) BatchDelete

BatchDelete mocks base method.

func (*MockAerospike) BatchGet

func (m *MockAerospike) BatchGet(arg0 *aerospike0.BatchPolicy, arg1 []*aerospike0.Key, arg2 ...string) ([]*aerospike0.Record, aerospike0.Error)

BatchGet mocks base method.

func (*MockAerospike) BatchOperate

func (m *MockAerospike) BatchOperate(policy *aerospike0.BatchPolicy, records []aerospike0.BatchRecordIfc) aerospike0.Error

BatchOperate mocks base method.

func (*MockAerospike) CreateComplexIndex

func (m *MockAerospike) CreateComplexIndex(arg0 *aerospike0.WritePolicy, arg1, arg2, arg3, arg4 string, arg5 aerospike0.IndexType, arg6 aerospike0.IndexCollectionType, arg7 ...*aerospike0.CDTContext) (*aerospike0.IndexTask, aerospike0.Error)

CreateComplexIndex mocks base method.

func (*MockAerospike) CreateIndex

func (m *MockAerospike) CreateIndex(arg0 *aerospike0.WritePolicy, arg1, arg2, arg3, arg4 string, arg5 aerospike0.IndexType) (*aerospike0.IndexTask, aerospike0.Error)

CreateIndex mocks base method.

func (*MockAerospike) Delete

func (m *MockAerospike) Delete(policy *aerospike0.WritePolicy, key *aerospike0.Key) (bool, aerospike0.Error)

Delete mocks base method.

func (*MockAerospike) DropIndex

func (m *MockAerospike) DropIndex(policy *aerospike0.WritePolicy, namespace, setName, indexName string) aerospike0.Error

DropIndex mocks base method.

func (*MockAerospike) EXPECT

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

func (*MockAerospike) ExecuteUDF

func (m *MockAerospike) ExecuteUDF(policy *aerospike0.QueryPolicy, statement *aerospike0.Statement, packageName, functionName string, functionArgs ...aerospike0.Value) (*aerospike0.ExecuteTask, aerospike0.Error)

ExecuteUDF mocks base method.

func (*MockAerospike) Exists

func (m *MockAerospike) Exists(policy *aerospike0.BasePolicy, key *aerospike0.Key) (bool, aerospike0.Error)

Exists mocks base method.

func (*MockAerospike) Get

Get mocks base method.

func (*MockAerospike) GetNodeNames

func (m *MockAerospike) GetNodeNames() []string

GetNodeNames mocks base method.

func (*MockAerospike) IsConnected

func (m *MockAerospike) IsConnected() bool

IsConnected mocks base method.

func (*MockAerospike) Operate

Operate mocks base method.

func (*MockAerospike) Put

Put mocks base method.

func (*MockAerospike) PutBins

func (m *MockAerospike) PutBins(arg0 *aerospike0.WritePolicy, arg1 *aerospike0.Key, arg2 ...*aerospike0.Bin) aerospike0.Error

PutBins mocks base method.

func (*MockAerospike) Query

Query mocks base method.

func (*MockAerospike) QueryAggregate

func (m *MockAerospike) QueryAggregate(policy *aerospike0.QueryPolicy, statement *aerospike0.Statement, packageName, functionName string, functionArgs ...aerospike0.Value) (*aerospike0.Recordset, aerospike0.Error)

QueryAggregate mocks base method.

func (*MockAerospike) RegisterUDF

func (m *MockAerospike) RegisterUDF(policy *aerospike0.WritePolicy, udfBody []byte, serverPath string, language aerospike0.Language) (*aerospike0.RegisterTask, aerospike0.Error)

RegisterUDF mocks base method.

func (*MockAerospike) RegisterUDFFromFile

func (m *MockAerospike) RegisterUDFFromFile(policy *aerospike0.WritePolicy, clientPath, serverPath string, language aerospike0.Language) (*aerospike0.RegisterTask, aerospike0.Error)

RegisterUDFFromFile mocks base method.

func (*MockAerospike) Stats

func (m *MockAerospike) Stats() (map[string]interface{}, aerospike0.Error)

Stats mocks base method.

func (*MockAerospike) Truncate

func (m *MockAerospike) Truncate(policy *aerospike0.InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) aerospike0.Error

Truncate mocks base method.

type MockAerospikeMockRecorder

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

MockAerospikeMockRecorder is the mock recorder for MockAerospike.

func (*MockAerospikeMockRecorder) BatchDelete

func (mr *MockAerospikeMockRecorder) BatchDelete(policy, deletePolicy, keys interface{}) *gomock.Call

BatchDelete indicates an expected call of BatchDelete.

func (*MockAerospikeMockRecorder) BatchGet

func (mr *MockAerospikeMockRecorder) BatchGet(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

BatchGet indicates an expected call of BatchGet.

func (*MockAerospikeMockRecorder) BatchOperate

func (mr *MockAerospikeMockRecorder) BatchOperate(policy, records interface{}) *gomock.Call

BatchOperate indicates an expected call of BatchOperate.

func (*MockAerospikeMockRecorder) CreateComplexIndex

func (mr *MockAerospikeMockRecorder) CreateComplexIndex(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}, arg7 ...interface{}) *gomock.Call

CreateComplexIndex indicates an expected call of CreateComplexIndex.

func (*MockAerospikeMockRecorder) CreateIndex

func (mr *MockAerospikeMockRecorder) CreateIndex(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

CreateIndex indicates an expected call of CreateIndex.

func (*MockAerospikeMockRecorder) Delete

func (mr *MockAerospikeMockRecorder) Delete(policy, key interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockAerospikeMockRecorder) DropIndex

func (mr *MockAerospikeMockRecorder) DropIndex(policy, namespace, setName, indexName interface{}) *gomock.Call

DropIndex indicates an expected call of DropIndex.

func (*MockAerospikeMockRecorder) ExecuteUDF

func (mr *MockAerospikeMockRecorder) ExecuteUDF(policy, statement, packageName, functionName interface{}, functionArgs ...interface{}) *gomock.Call

ExecuteUDF indicates an expected call of ExecuteUDF.

func (*MockAerospikeMockRecorder) Exists

func (mr *MockAerospikeMockRecorder) Exists(policy, key interface{}) *gomock.Call

Exists indicates an expected call of Exists.

func (*MockAerospikeMockRecorder) Get

func (mr *MockAerospikeMockRecorder) Get(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockAerospikeMockRecorder) GetNodeNames

func (mr *MockAerospikeMockRecorder) GetNodeNames() *gomock.Call

GetNodeNames indicates an expected call of GetNodeNames.

func (*MockAerospikeMockRecorder) IsConnected

func (mr *MockAerospikeMockRecorder) IsConnected() *gomock.Call

IsConnected indicates an expected call of IsConnected.

func (*MockAerospikeMockRecorder) Operate

func (mr *MockAerospikeMockRecorder) Operate(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

Operate indicates an expected call of Operate.

func (*MockAerospikeMockRecorder) Put

func (mr *MockAerospikeMockRecorder) Put(arg0, arg1, arg2 interface{}) *gomock.Call

Put indicates an expected call of Put.

func (*MockAerospikeMockRecorder) PutBins

func (mr *MockAerospikeMockRecorder) PutBins(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

PutBins indicates an expected call of PutBins.

func (*MockAerospikeMockRecorder) Query

func (mr *MockAerospikeMockRecorder) Query(arg0, arg1 interface{}) *gomock.Call

Query indicates an expected call of Query.

func (*MockAerospikeMockRecorder) QueryAggregate

func (mr *MockAerospikeMockRecorder) QueryAggregate(policy, statement, packageName, functionName interface{}, functionArgs ...interface{}) *gomock.Call

QueryAggregate indicates an expected call of QueryAggregate.

func (*MockAerospikeMockRecorder) RegisterUDF

func (mr *MockAerospikeMockRecorder) RegisterUDF(policy, udfBody, serverPath, language interface{}) *gomock.Call

RegisterUDF indicates an expected call of RegisterUDF.

func (*MockAerospikeMockRecorder) RegisterUDFFromFile

func (mr *MockAerospikeMockRecorder) RegisterUDFFromFile(policy, clientPath, serverPath, language interface{}) *gomock.Call

RegisterUDFFromFile indicates an expected call of RegisterUDFFromFile.

func (*MockAerospikeMockRecorder) Stats

func (mr *MockAerospikeMockRecorder) Stats() *gomock.Call

Stats indicates an expected call of Stats.

func (*MockAerospikeMockRecorder) Truncate

func (mr *MockAerospikeMockRecorder) Truncate(policy, namespace, set, beforeLastUpdate interface{}) *gomock.Call

Truncate indicates an expected call of Truncate.

type MockNamespace

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

MockNamespace is a mock of Namespace interface.

func NewMockNamespace

func NewMockNamespace(ctrl *gomock.Controller) *MockNamespace

NewMockNamespace creates a new mock instance.

func (*MockNamespace) BatchDelete

BatchDelete mocks base method.

func (*MockNamespace) BatchGet

func (m *MockNamespace) BatchGet(arg0 *aerospike0.BatchPolicy, arg1 []aerospike.SetKey, arg2 ...string) ([]*aerospike0.Record, aerospike0.Error)

BatchGet mocks base method.

func (*MockNamespace) BatchOperate

func (m *MockNamespace) BatchOperate(policy *aerospike0.BatchPolicy, records []aerospike0.BatchRecordIfc) aerospike0.Error

BatchOperate mocks base method.

func (*MockNamespace) CreateComplexIndex

func (m *MockNamespace) CreateComplexIndex(policy *aerospike0.WritePolicy, set, indexName, field string, indexType aerospike0.IndexType, collectionType aerospike0.IndexCollectionType, ctx ...*aerospike0.CDTContext) (*aerospike0.IndexTask, aerospike0.Error)

CreateComplexIndex mocks base method.

func (*MockNamespace) CreateIndex

func (m *MockNamespace) CreateIndex(policy *aerospike0.WritePolicy, set, indexName, fieldName string, indexType aerospike0.IndexType) (*aerospike0.IndexTask, aerospike0.Error)

CreateIndex mocks base method.

func (*MockNamespace) Delete

func (m *MockNamespace) Delete(policy *aerospike0.WritePolicy, setName string, value interface{}) (bool, aerospike0.Error)

Delete mocks base method.

func (*MockNamespace) DropIndex

func (m *MockNamespace) DropIndex(policy *aerospike0.WritePolicy, setName, indexName string) aerospike0.Error

DropIndex mocks base method.

func (*MockNamespace) EXPECT

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

func (*MockNamespace) Exists

func (m *MockNamespace) Exists(arg0 *aerospike0.BasePolicy, arg1 string, arg2 interface{}) (bool, aerospike0.Error)

Exists mocks base method.

func (*MockNamespace) Get

func (m *MockNamespace) Get(policy *aerospike0.BasePolicy, setName string, value interface{}, binNames ...string) (*aerospike0.Record, aerospike0.Error)

Get mocks base method.

func (*MockNamespace) GetConnection

func (m *MockNamespace) GetConnection() aerospike.Aerospike

GetConnection mocks base method.

func (*MockNamespace) GetNamespace

func (m *MockNamespace) GetNamespace() string

GetNamespace mocks base method.

func (*MockNamespace) Operate

func (m *MockNamespace) Operate(policy *aerospike0.WritePolicy, setName string, value interface{}, ops ...*aerospike0.Operation) (*aerospike0.Record, aerospike0.Error)

Operate mocks base method.

func (*MockNamespace) Put

func (m *MockNamespace) Put(arg0 *aerospike0.WritePolicy, arg1 string, arg2 interface{}, arg3 aerospike0.BinMap) aerospike0.Error

Put mocks base method.

func (*MockNamespace) PutBins

func (m *MockNamespace) PutBins(policy *aerospike0.WritePolicy, setName string, value interface{}, bins ...*aerospike0.Bin) aerospike0.Error

PutBins mocks base method.

func (*MockNamespace) Query

Query mocks base method.

func (*MockNamespace) QueryAggregate

func (m *MockNamespace) QueryAggregate(policy *aerospike0.QueryPolicy, statement *aerospike0.Statement, packageName, functionName string, functionArgs ...aerospike0.Value) (*aerospike0.Recordset, aerospike0.Error)

QueryAggregate mocks base method.

func (*MockNamespace) Stats

func (m *MockNamespace) Stats() (map[string]interface{}, aerospike0.Error)

Stats mocks base method.

func (*MockNamespace) Truncate

func (m *MockNamespace) Truncate(policy *aerospike0.InfoPolicy, set string, beforeLastUpdate *time.Time) aerospike0.Error

Truncate mocks base method.

type MockNamespaceMockRecorder

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

MockNamespaceMockRecorder is the mock recorder for MockNamespace.

func (*MockNamespaceMockRecorder) BatchDelete

func (mr *MockNamespaceMockRecorder) BatchDelete(policy, deletePolicy, values interface{}) *gomock.Call

BatchDelete indicates an expected call of BatchDelete.

func (*MockNamespaceMockRecorder) BatchGet

func (mr *MockNamespaceMockRecorder) BatchGet(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

BatchGet indicates an expected call of BatchGet.

func (*MockNamespaceMockRecorder) BatchOperate

func (mr *MockNamespaceMockRecorder) BatchOperate(policy, records interface{}) *gomock.Call

BatchOperate indicates an expected call of BatchOperate.

func (*MockNamespaceMockRecorder) CreateComplexIndex

func (mr *MockNamespaceMockRecorder) CreateComplexIndex(policy, set, indexName, field, indexType, collectionType interface{}, ctx ...interface{}) *gomock.Call

CreateComplexIndex indicates an expected call of CreateComplexIndex.

func (*MockNamespaceMockRecorder) CreateIndex

func (mr *MockNamespaceMockRecorder) CreateIndex(policy, set, indexName, fieldName, indexType interface{}) *gomock.Call

CreateIndex indicates an expected call of CreateIndex.

func (*MockNamespaceMockRecorder) Delete

func (mr *MockNamespaceMockRecorder) Delete(policy, setName, value interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockNamespaceMockRecorder) DropIndex

func (mr *MockNamespaceMockRecorder) DropIndex(policy, setName, indexName interface{}) *gomock.Call

DropIndex indicates an expected call of DropIndex.

func (*MockNamespaceMockRecorder) Exists

func (mr *MockNamespaceMockRecorder) Exists(arg0, arg1, arg2 interface{}) *gomock.Call

Exists indicates an expected call of Exists.

func (*MockNamespaceMockRecorder) Get

func (mr *MockNamespaceMockRecorder) Get(policy, setName, value interface{}, binNames ...interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockNamespaceMockRecorder) GetConnection

func (mr *MockNamespaceMockRecorder) GetConnection() *gomock.Call

GetConnection indicates an expected call of GetConnection.

func (*MockNamespaceMockRecorder) GetNamespace

func (mr *MockNamespaceMockRecorder) GetNamespace() *gomock.Call

GetNamespace indicates an expected call of GetNamespace.

func (*MockNamespaceMockRecorder) Operate

func (mr *MockNamespaceMockRecorder) Operate(policy, setName, value interface{}, ops ...interface{}) *gomock.Call

Operate indicates an expected call of Operate.

func (*MockNamespaceMockRecorder) Put

func (mr *MockNamespaceMockRecorder) Put(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Put indicates an expected call of Put.

func (*MockNamespaceMockRecorder) PutBins

func (mr *MockNamespaceMockRecorder) PutBins(policy, setName, value interface{}, bins ...interface{}) *gomock.Call

PutBins indicates an expected call of PutBins.

func (*MockNamespaceMockRecorder) Query

func (mr *MockNamespaceMockRecorder) Query(arg0, arg1 interface{}) *gomock.Call

Query indicates an expected call of Query.

func (*MockNamespaceMockRecorder) QueryAggregate

func (mr *MockNamespaceMockRecorder) QueryAggregate(policy, statement, packageName, functionName interface{}, functionArgs ...interface{}) *gomock.Call

QueryAggregate indicates an expected call of QueryAggregate.

func (*MockNamespaceMockRecorder) Stats

func (mr *MockNamespaceMockRecorder) Stats() *gomock.Call

Stats indicates an expected call of Stats.

func (*MockNamespaceMockRecorder) Truncate

func (mr *MockNamespaceMockRecorder) Truncate(policy, set, beforeLastUpdate interface{}) *gomock.Call

Truncate indicates an expected call of Truncate.

Jump to

Keyboard shortcuts

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