migration

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 14 Imported by: 20

Documentation

Overview

Package migration is a generated GoMock package.

Index

Constants

View Source
const (
	CheckAndCreateChMigrationTable = `` /* 266-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func Run

func Run(migrationsMap map[int64]Migrate, c *container.Container)

Types

type ArangoDB added in v1.34.0

type ArangoDB interface {
	// CreateDB creates a new database in ArangoDB.
	CreateDB(ctx context.Context, database string) error
	// DropDB deletes an existing database in ArangoDB.
	DropDB(ctx context.Context, database string) error

	// CreateCollection creates a new collection in a database with specified type.
	CreateCollection(ctx context.Context, database, collection string, isEdge bool) error
	// DropCollection deletes an existing collection from a database.
	DropCollection(ctx context.Context, database, collection string) error

	// CreateGraph creates a new graph in a database.
	CreateGraph(ctx context.Context, database, graph string, edgeDefinitions any) error
	// DropGraph deletes an existing graph from a database.
	DropGraph(ctx context.Context, database, graph string) error
}

ArangoDB is an interface representing an ArangoDB database client with common CRUD operations.

type Cassandra added in v1.21.0

type Cassandra interface {
	Exec(query string, args ...any) error
	NewBatch(name string, batchType int) error
	BatchQuery(name, stmt string, values ...any) error
	ExecuteBatch(name string) error

	HealthCheck(ctx context.Context) (any, error)
}

type Clickhouse added in v1.12.0

type Clickhouse interface {
	Exec(ctx context.Context, query string, args ...any) error
	Select(ctx context.Context, dest any, query string, args ...any) error
	AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error

	HealthCheck(ctx context.Context) (any, error)
}

type DGraph added in v1.37.0

type DGraph interface {
	// ApplySchema applies or updates the complete database schema.
	// Parameters:
	// - ctx: Context for request cancellation and timeouts
	// - schema: Schema definition in Dgraph Schema Definition Language (SDL) format
	// Returns:
	// - error: An error if the schema application fails
	ApplySchema(ctx context.Context, schema string) error

	// AddOrUpdateField atomically creates or updates a single field definition.
	// Parameters:
	// - ctx: Context for request cancellation and timeouts
	// - fieldName: Name of the field/predicate to create or update
	// - fieldType: Dgraph data type (e.g., string, int, datetime)
	// - directives: Space-separated Dgraph directives (e.g., "@index(hash) @upsert")
	// Returns:
	// - error: An error if the field operation fails
	AddOrUpdateField(ctx context.Context, fieldName, fieldType, directives string) error

	// DropField permanently removes a field/predicate and all its associated data.
	// Parameters:
	// - ctx: Context for request cancellation and timeouts
	// - fieldName: Name of the field/predicate to remove
	// Returns:
	// - error: An error if the field removal fails
	DropField(ctx context.Context, fieldName string) error
}

type Datasource

type Datasource struct {
	// TODO Logger should not be embedded rather it should be a field.
	// Need to think it through as it will bring breaking changes.
	Logger

	SQL        SQL
	Redis      Redis
	PubSub     PubSub
	Clickhouse Clickhouse
	Cassandra  Cassandra
	Mongo      Mongo
	ArangoDB   ArangoDB
	SurrealDB  SurrealDB
	DGraph     DGraph
}

type Logger

type Logger interface {
	Debug(args ...any)
	Debugf(format string, args ...any)
	Info(args ...any)
	Infof(format string, args ...any)
	Notice(args ...any)
	Noticef(format string, args ...any)
	Warn(args ...any)
	Warnf(format string, args ...any)
	Error(args ...any)
	Errorf(format string, args ...any)
	Fatal(args ...any)
	Fatalf(format string, args ...any)
}

type Migrate

type Migrate struct {
	UP MigrateFunc
}

type MigrateFunc

type MigrateFunc func(d Datasource) error

type MockArangoDB added in v1.34.0

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

MockArangoDB is a mock of ArangoDB interface.

func NewMockArangoDB added in v1.34.0

func NewMockArangoDB(ctrl *gomock.Controller) *MockArangoDB

NewMockArangoDB creates a new mock instance.

func (*MockArangoDB) CreateCollection added in v1.34.0

func (m *MockArangoDB) CreateCollection(ctx context.Context, database, collection string, isEdge bool) error

CreateCollection mocks base method.

func (*MockArangoDB) CreateDB added in v1.34.0

func (m *MockArangoDB) CreateDB(ctx context.Context, database string) error

CreateDB mocks base method.

func (*MockArangoDB) CreateGraph added in v1.34.0

func (m *MockArangoDB) CreateGraph(ctx context.Context, database, graph string, edgeDefinitions any) error

CreateGraph mocks base method.

func (*MockArangoDB) DropCollection added in v1.34.0

func (m *MockArangoDB) DropCollection(ctx context.Context, database, collection string) error

DropCollection mocks base method.

func (*MockArangoDB) DropDB added in v1.34.0

func (m *MockArangoDB) DropDB(ctx context.Context, database string) error

DropDB mocks base method.

func (*MockArangoDB) DropGraph added in v1.34.0

func (m *MockArangoDB) DropGraph(ctx context.Context, database, graph string) error

DropGraph mocks base method.

func (*MockArangoDB) EXPECT added in v1.34.0

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

type MockArangoDBMockRecorder added in v1.34.0

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

MockArangoDBMockRecorder is the mock recorder for MockArangoDB.

func (*MockArangoDBMockRecorder) CreateCollection added in v1.34.0

func (mr *MockArangoDBMockRecorder) CreateCollection(ctx, database, collection, isEdge any) *gomock.Call

CreateCollection indicates an expected call of CreateCollection.

func (*MockArangoDBMockRecorder) CreateDB added in v1.34.0

func (mr *MockArangoDBMockRecorder) CreateDB(ctx, database any) *gomock.Call

CreateDB indicates an expected call of CreateDB.

func (*MockArangoDBMockRecorder) CreateGraph added in v1.34.0

func (mr *MockArangoDBMockRecorder) CreateGraph(ctx, database, graph, edgeDefinitions any) *gomock.Call

CreateGraph indicates an expected call of CreateGraph.

func (*MockArangoDBMockRecorder) DropCollection added in v1.34.0

func (mr *MockArangoDBMockRecorder) DropCollection(ctx, database, collection any) *gomock.Call

DropCollection indicates an expected call of DropCollection.

func (*MockArangoDBMockRecorder) DropDB added in v1.34.0

func (mr *MockArangoDBMockRecorder) DropDB(ctx, database any) *gomock.Call

DropDB indicates an expected call of DropDB.

func (*MockArangoDBMockRecorder) DropGraph added in v1.34.0

func (mr *MockArangoDBMockRecorder) DropGraph(ctx, database, graph any) *gomock.Call

DropGraph indicates an expected call of DropGraph.

type MockCassandra added in v1.34.0

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

MockCassandra is a mock of Cassandra interface.

func NewMockCassandra added in v1.34.0

func NewMockCassandra(ctrl *gomock.Controller) *MockCassandra

NewMockCassandra creates a new mock instance.

func (*MockCassandra) BatchQuery added in v1.34.0

func (m *MockCassandra) BatchQuery(name, stmt string, values ...any) error

BatchQuery mocks base method.

func (*MockCassandra) EXPECT added in v1.34.0

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

func (*MockCassandra) Exec added in v1.34.0

func (m *MockCassandra) Exec(query string, args ...any) error

Exec mocks base method.

func (*MockCassandra) ExecuteBatch added in v1.34.0

func (m *MockCassandra) ExecuteBatch(name string) error

ExecuteBatch mocks base method.

func (*MockCassandra) HealthCheck added in v1.34.0

func (m *MockCassandra) HealthCheck(ctx context.Context) (any, error)

HealthCheck mocks base method.

func (*MockCassandra) NewBatch added in v1.34.0

func (m *MockCassandra) NewBatch(name string, batchType int) error

NewBatch mocks base method.

type MockCassandraMockRecorder added in v1.34.0

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

MockCassandraMockRecorder is the mock recorder for MockCassandra.

func (*MockCassandraMockRecorder) BatchQuery added in v1.34.0

func (mr *MockCassandraMockRecorder) BatchQuery(name, stmt any, values ...any) *gomock.Call

BatchQuery indicates an expected call of BatchQuery.

func (*MockCassandraMockRecorder) Exec added in v1.34.0

func (mr *MockCassandraMockRecorder) Exec(query any, args ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockCassandraMockRecorder) ExecuteBatch added in v1.34.0

func (mr *MockCassandraMockRecorder) ExecuteBatch(name any) *gomock.Call

ExecuteBatch indicates an expected call of ExecuteBatch.

func (*MockCassandraMockRecorder) HealthCheck added in v1.34.0

func (mr *MockCassandraMockRecorder) HealthCheck(ctx any) *gomock.Call

HealthCheck indicates an expected call of HealthCheck.

func (*MockCassandraMockRecorder) NewBatch added in v1.34.0

func (mr *MockCassandraMockRecorder) NewBatch(name, batchType any) *gomock.Call

NewBatch indicates an expected call of NewBatch.

type MockClickhouse added in v1.12.0

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

MockClickhouse is a mock of Clickhouse interface.

func NewMockClickhouse added in v1.12.0

func NewMockClickhouse(ctrl *gomock.Controller) *MockClickhouse

NewMockClickhouse creates a new mock instance.

func (*MockClickhouse) AsyncInsert added in v1.12.0

func (m *MockClickhouse) AsyncInsert(ctx context.Context, query string, wait bool, args ...any) error

AsyncInsert mocks base method.

func (*MockClickhouse) EXPECT added in v1.12.0

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

func (*MockClickhouse) Exec added in v1.12.0

func (m *MockClickhouse) Exec(ctx context.Context, query string, args ...any) error

Exec mocks base method.

func (*MockClickhouse) HealthCheck added in v1.13.0

func (m *MockClickhouse) HealthCheck(ctx context.Context) (any, error)

HealthCheck mocks base method.

func (*MockClickhouse) Select added in v1.12.0

func (m *MockClickhouse) Select(ctx context.Context, dest any, query string, args ...any) error

Select mocks base method.

type MockClickhouseMockRecorder added in v1.12.0

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

MockClickhouseMockRecorder is the mock recorder for MockClickhouse.

func (*MockClickhouseMockRecorder) AsyncInsert added in v1.12.0

func (mr *MockClickhouseMockRecorder) AsyncInsert(ctx, query, wait any, args ...any) *gomock.Call

AsyncInsert indicates an expected call of AsyncInsert.

func (*MockClickhouseMockRecorder) Exec added in v1.12.0

func (mr *MockClickhouseMockRecorder) Exec(ctx, query any, args ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockClickhouseMockRecorder) HealthCheck added in v1.13.0

func (mr *MockClickhouseMockRecorder) HealthCheck(ctx any) *gomock.Call

HealthCheck indicates an expected call of HealthCheck.

func (*MockClickhouseMockRecorder) Select added in v1.12.0

func (mr *MockClickhouseMockRecorder) Select(ctx, dest, query any, args ...any) *gomock.Call

Select indicates an expected call of Select.

type MockMongo added in v1.34.0

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

MockMongo is a mock of Mongo interface.

func NewMockMongo added in v1.34.0

func NewMockMongo(ctrl *gomock.Controller) *MockMongo

NewMockMongo creates a new mock instance.

func (*MockMongo) CreateCollection added in v1.34.0

func (m *MockMongo) CreateCollection(ctx context.Context, name string) error

CreateCollection mocks base method.

func (*MockMongo) DeleteMany added in v1.34.0

func (m *MockMongo) DeleteMany(ctx context.Context, collection string, filter any) (int64, error)

DeleteMany mocks base method.

func (*MockMongo) DeleteOne added in v1.34.0

func (m *MockMongo) DeleteOne(ctx context.Context, collection string, filter any) (int64, error)

DeleteOne mocks base method.

func (*MockMongo) Drop added in v1.34.0

func (m *MockMongo) Drop(ctx context.Context, collection string) error

Drop mocks base method.

func (*MockMongo) EXPECT added in v1.34.0

func (m *MockMongo) EXPECT() *MockMongoMockRecorder

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

func (*MockMongo) Find added in v1.34.0

func (m *MockMongo) Find(ctx context.Context, collection string, filter, results any) error

Find mocks base method.

func (*MockMongo) FindOne added in v1.34.0

func (m *MockMongo) FindOne(ctx context.Context, collection string, filter, result any) error

FindOne mocks base method.

func (*MockMongo) InsertMany added in v1.34.0

func (m *MockMongo) InsertMany(ctx context.Context, collection string, documents []any) ([]any, error)

InsertMany mocks base method.

func (*MockMongo) InsertOne added in v1.34.0

func (m *MockMongo) InsertOne(ctx context.Context, collection string, document any) (any, error)

InsertOne mocks base method.

func (*MockMongo) StartSession added in v1.34.0

func (m *MockMongo) StartSession() (any, error)

StartSession mocks base method.

func (*MockMongo) UpdateByID added in v1.34.0

func (m *MockMongo) UpdateByID(ctx context.Context, collection string, id, update any) (int64, error)

UpdateByID mocks base method.

func (*MockMongo) UpdateMany added in v1.34.0

func (m *MockMongo) UpdateMany(ctx context.Context, collection string, filter, update any) (int64, error)

UpdateMany mocks base method.

func (*MockMongo) UpdateOne added in v1.34.0

func (m *MockMongo) UpdateOne(ctx context.Context, collection string, filter, update any) error

UpdateOne mocks base method.

type MockMongoMockRecorder added in v1.34.0

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

MockMongoMockRecorder is the mock recorder for MockMongo.

func (*MockMongoMockRecorder) CreateCollection added in v1.34.0

func (mr *MockMongoMockRecorder) CreateCollection(ctx, name any) *gomock.Call

CreateCollection indicates an expected call of CreateCollection.

func (*MockMongoMockRecorder) DeleteMany added in v1.34.0

func (mr *MockMongoMockRecorder) DeleteMany(ctx, collection, filter any) *gomock.Call

DeleteMany indicates an expected call of DeleteMany.

func (*MockMongoMockRecorder) DeleteOne added in v1.34.0

func (mr *MockMongoMockRecorder) DeleteOne(ctx, collection, filter any) *gomock.Call

DeleteOne indicates an expected call of DeleteOne.

func (*MockMongoMockRecorder) Drop added in v1.34.0

func (mr *MockMongoMockRecorder) Drop(ctx, collection any) *gomock.Call

Drop indicates an expected call of Drop.

func (*MockMongoMockRecorder) Find added in v1.34.0

func (mr *MockMongoMockRecorder) Find(ctx, collection, filter, results any) *gomock.Call

Find indicates an expected call of Find.

func (*MockMongoMockRecorder) FindOne added in v1.34.0

func (mr *MockMongoMockRecorder) FindOne(ctx, collection, filter, result any) *gomock.Call

FindOne indicates an expected call of FindOne.

func (*MockMongoMockRecorder) InsertMany added in v1.34.0

func (mr *MockMongoMockRecorder) InsertMany(ctx, collection, documents any) *gomock.Call

InsertMany indicates an expected call of InsertMany.

func (*MockMongoMockRecorder) InsertOne added in v1.34.0

func (mr *MockMongoMockRecorder) InsertOne(ctx, collection, document any) *gomock.Call

InsertOne indicates an expected call of InsertOne.

func (*MockMongoMockRecorder) StartSession added in v1.34.0

func (mr *MockMongoMockRecorder) StartSession() *gomock.Call

StartSession indicates an expected call of StartSession.

func (*MockMongoMockRecorder) UpdateByID added in v1.34.0

func (mr *MockMongoMockRecorder) UpdateByID(ctx, collection, id, update any) *gomock.Call

UpdateByID indicates an expected call of UpdateByID.

func (*MockMongoMockRecorder) UpdateMany added in v1.34.0

func (mr *MockMongoMockRecorder) UpdateMany(ctx, collection, filter, update any) *gomock.Call

UpdateMany indicates an expected call of UpdateMany.

func (*MockMongoMockRecorder) UpdateOne added in v1.34.0

func (mr *MockMongoMockRecorder) UpdateOne(ctx, collection, filter, update any) *gomock.Call

UpdateOne indicates an expected call of UpdateOne.

type MockPubSub added in v1.12.0

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

MockPubSub is a mock of PubSub interface.

func NewMockPubSub added in v1.12.0

func NewMockPubSub(ctrl *gomock.Controller) *MockPubSub

NewMockPubSub creates a new mock instance.

func (*MockPubSub) CreateTopic added in v1.12.0

func (m *MockPubSub) CreateTopic(context context.Context, name string) error

CreateTopic mocks base method.

func (*MockPubSub) DeleteTopic added in v1.12.0

func (m *MockPubSub) DeleteTopic(context context.Context, name string) error

DeleteTopic mocks base method.

func (*MockPubSub) EXPECT added in v1.12.0

func (m *MockPubSub) EXPECT() *MockPubSubMockRecorder

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

type MockPubSubMockRecorder added in v1.12.0

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

MockPubSubMockRecorder is the mock recorder for MockPubSub.

func (*MockPubSubMockRecorder) CreateTopic added in v1.12.0

func (mr *MockPubSubMockRecorder) CreateTopic(context, name any) *gomock.Call

CreateTopic indicates an expected call of CreateTopic.

func (*MockPubSubMockRecorder) DeleteTopic added in v1.12.0

func (mr *MockPubSubMockRecorder) DeleteTopic(context, name any) *gomock.Call

DeleteTopic indicates an expected call of DeleteTopic.

type MockRedis added in v1.12.0

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

MockRedis is a mock of Redis interface.

func NewMockRedis added in v1.12.0

func NewMockRedis(ctrl *gomock.Controller) *MockRedis

NewMockRedis creates a new mock instance.

func (*MockRedis) Del added in v1.12.0

func (m *MockRedis) Del(ctx context.Context, keys ...string) *redis.IntCmd

Del mocks base method.

func (*MockRedis) EXPECT added in v1.12.0

func (m *MockRedis) EXPECT() *MockRedisMockRecorder

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

func (*MockRedis) Get added in v1.12.0

func (m *MockRedis) Get(ctx context.Context, key string) *redis.StringCmd

Get mocks base method.

func (*MockRedis) Rename added in v1.12.0

func (m *MockRedis) Rename(ctx context.Context, key, newKey string) *redis.StatusCmd

Rename mocks base method.

func (*MockRedis) Set added in v1.12.0

func (m *MockRedis) Set(ctx context.Context, key string, value any, expiration time.Duration) *redis.StatusCmd

Set mocks base method.

type MockRedisMockRecorder added in v1.12.0

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

MockRedisMockRecorder is the mock recorder for MockRedis.

func (*MockRedisMockRecorder) Del added in v1.12.0

func (mr *MockRedisMockRecorder) Del(ctx any, keys ...any) *gomock.Call

Del indicates an expected call of Del.

func (*MockRedisMockRecorder) Get added in v1.12.0

func (mr *MockRedisMockRecorder) Get(ctx, key any) *gomock.Call

Get indicates an expected call of Get.

func (*MockRedisMockRecorder) Rename added in v1.12.0

func (mr *MockRedisMockRecorder) Rename(ctx, key, newKey any) *gomock.Call

Rename indicates an expected call of Rename.

func (*MockRedisMockRecorder) Set added in v1.12.0

func (mr *MockRedisMockRecorder) Set(ctx, key, value, expiration any) *gomock.Call

Set indicates an expected call of Set.

type MockSQL added in v1.12.0

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

MockSQL is a mock of SQL interface.

func NewMockSQL added in v1.12.0

func NewMockSQL(ctrl *gomock.Controller) *MockSQL

NewMockSQL creates a new mock instance.

func (*MockSQL) EXPECT added in v1.12.0

func (m *MockSQL) EXPECT() *MockSQLMockRecorder

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

func (*MockSQL) Exec added in v1.12.0

func (m *MockSQL) Exec(query string, args ...any) (sql.Result, error)

Exec mocks base method.

func (*MockSQL) ExecContext added in v1.12.0

func (m *MockSQL) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

ExecContext mocks base method.

func (*MockSQL) Query added in v1.12.0

func (m *MockSQL) Query(query string, args ...any) (*sql.Rows, error)

Query mocks base method.

func (*MockSQL) QueryRow added in v1.12.0

func (m *MockSQL) QueryRow(query string, args ...any) *sql.Row

QueryRow mocks base method.

func (*MockSQL) QueryRowContext added in v1.12.0

func (m *MockSQL) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row

QueryRowContext mocks base method.

type MockSQLMockRecorder added in v1.12.0

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

MockSQLMockRecorder is the mock recorder for MockSQL.

func (*MockSQLMockRecorder) Exec added in v1.12.0

func (mr *MockSQLMockRecorder) Exec(query any, args ...any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockSQLMockRecorder) ExecContext added in v1.12.0

func (mr *MockSQLMockRecorder) ExecContext(ctx, query any, args ...any) *gomock.Call

ExecContext indicates an expected call of ExecContext.

func (*MockSQLMockRecorder) Query added in v1.12.0

func (mr *MockSQLMockRecorder) Query(query any, args ...any) *gomock.Call

Query indicates an expected call of Query.

func (*MockSQLMockRecorder) QueryRow added in v1.12.0

func (mr *MockSQLMockRecorder) QueryRow(query any, args ...any) *gomock.Call

QueryRow indicates an expected call of QueryRow.

func (*MockSQLMockRecorder) QueryRowContext added in v1.12.0

func (mr *MockSQLMockRecorder) QueryRowContext(ctx, query any, args ...any) *gomock.Call

QueryRowContext indicates an expected call of QueryRowContext.

type MockSurrealDB added in v1.36.0

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

MockSurrealDB is a mock of SurrealDB interface.

func NewMockSurrealDB added in v1.36.0

func NewMockSurrealDB(ctrl *gomock.Controller) *MockSurrealDB

NewMockSurrealDB creates a new mock instance.

func (*MockSurrealDB) CreateDatabase added in v1.36.0

func (m *MockSurrealDB) CreateDatabase(ctx context.Context, database string) error

CreateDatabase mocks base method.

func (*MockSurrealDB) CreateNamespace added in v1.36.0

func (m *MockSurrealDB) CreateNamespace(ctx context.Context, namespace string) error

CreateNamespace mocks base method.

func (*MockSurrealDB) DropDatabase added in v1.36.0

func (m *MockSurrealDB) DropDatabase(ctx context.Context, database string) error

DropDatabase mocks base method.

func (*MockSurrealDB) DropNamespace added in v1.36.0

func (m *MockSurrealDB) DropNamespace(ctx context.Context, namespace string) error

DropNamespace mocks base method.

func (*MockSurrealDB) EXPECT added in v1.36.0

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

func (*MockSurrealDB) Query added in v1.36.0

func (m *MockSurrealDB) Query(ctx context.Context, query string, vars map[string]any) ([]any, error)

Query mocks base method.

type MockSurrealDBMockRecorder added in v1.36.0

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

MockSurrealDBMockRecorder is the mock recorder for MockSurrealDB.

func (*MockSurrealDBMockRecorder) CreateDatabase added in v1.36.0

func (mr *MockSurrealDBMockRecorder) CreateDatabase(ctx, database any) *gomock.Call

CreateDatabase indicates an expected call of CreateDatabase.

func (*MockSurrealDBMockRecorder) CreateNamespace added in v1.36.0

func (mr *MockSurrealDBMockRecorder) CreateNamespace(ctx, namespace any) *gomock.Call

CreateNamespace indicates an expected call of CreateNamespace.

func (*MockSurrealDBMockRecorder) DropDatabase added in v1.36.0

func (mr *MockSurrealDBMockRecorder) DropDatabase(ctx, database any) *gomock.Call

DropDatabase indicates an expected call of DropDatabase.

func (*MockSurrealDBMockRecorder) DropNamespace added in v1.36.0

func (mr *MockSurrealDBMockRecorder) DropNamespace(ctx, namespace any) *gomock.Call

DropNamespace indicates an expected call of DropNamespace.

func (*MockSurrealDBMockRecorder) Query added in v1.36.0

func (mr *MockSurrealDBMockRecorder) Query(ctx, query, vars any) *gomock.Call

Query indicates an expected call of Query.

type Mockmigrator added in v1.12.0

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

Mockmigrator is a mock of migrator interface.

func NewMockmigrator added in v1.12.0

func NewMockmigrator(ctrl *gomock.Controller) *Mockmigrator

NewMockmigrator creates a new mock instance.

func (*Mockmigrator) EXPECT added in v1.12.0

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

type MockmigratorMockRecorder added in v1.12.0

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

MockmigratorMockRecorder is the mock recorder for Mockmigrator.

type Mongo added in v1.27.0

type Mongo interface {
	Find(ctx context.Context, collection string, filter any, results any) error
	FindOne(ctx context.Context, collection string, filter any, result any) error
	InsertOne(ctx context.Context, collection string, document any) (any, error)
	InsertMany(ctx context.Context, collection string, documents []any) ([]any, error)
	DeleteOne(ctx context.Context, collection string, filter any) (int64, error)
	DeleteMany(ctx context.Context, collection string, filter any) (int64, error)
	UpdateByID(ctx context.Context, collection string, id any, update any) (int64, error)
	UpdateOne(ctx context.Context, collection string, filter any, update any) error
	UpdateMany(ctx context.Context, collection string, filter any, update any) (int64, error)
	Drop(ctx context.Context, collection string) error
	CreateCollection(ctx context.Context, name string) error
	StartSession() (any, error)
}

Mongo is an interface representing a MongoDB database client with common CRUD operations.

type PubSub added in v1.12.0

type PubSub interface {
	CreateTopic(context context.Context, name string) error
	DeleteTopic(context context.Context, name string) error
}

type Redis added in v1.12.0

type Redis interface {
	Get(ctx context.Context, key string) *goRedis.StringCmd
	Set(ctx context.Context, key string, value any, expiration time.Duration) *goRedis.StatusCmd
	Del(ctx context.Context, keys ...string) *goRedis.IntCmd
	Rename(ctx context.Context, key, newKey string) *goRedis.StatusCmd
}

type SQL added in v1.12.0

type SQL interface {
	Query(query string, args ...any) (*sql.Rows, error)
	QueryRow(query string, args ...any) *sql.Row
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	Exec(query string, args ...any) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

type SurrealDB added in v1.36.0

type SurrealDB interface {
	// Query executes a Surreal query with the provided variables and returns the query results as a slice of interfaces{}.
	// It returns an error if the query execution fails.
	Query(ctx context.Context, query string, vars map[string]any) ([]any, error)

	// CreateNamespace creates a new namespace in the SurrealDB instance.
	CreateNamespace(ctx context.Context, namespace string) error

	// CreateDatabase creates a new database in the SurrealDB instance.
	CreateDatabase(ctx context.Context, database string) error

	// DropNamespace deletes a namespace from the SurrealDB instance.
	DropNamespace(ctx context.Context, namespace string) error

	// DropDatabase deletes a database from the SurrealDB instance.
	DropDatabase(ctx context.Context, database string) error
}

Jump to

Keyboard shortcuts

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