migration

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 16

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 Cassandra added in v1.21.0

type Cassandra interface {
	Exec(query string, args ...interface{}) 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 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
}

type Logger

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

type Migrate

type Migrate struct {
	UP MigrateFunc
}

type MigrateFunc

type MigrateFunc func(d Datasource) error

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 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 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 interface{}, 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 ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
	Exec(query string, args ...interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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