migration

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

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

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
}

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

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

MockClickhouse is a mock of Clickhouse interface.

func NewMockClickhouse

func NewMockClickhouse(ctrl *gomock.Controller) *MockClickhouse

NewMockClickhouse creates a new mock instance.

func (*MockClickhouse) AsyncInsert

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

AsyncInsert mocks base method.

func (*MockClickhouse) EXPECT

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

func (*MockClickhouse) Exec

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

Exec mocks base method.

func (*MockClickhouse) HealthCheck

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

HealthCheck mocks base method.

func (*MockClickhouse) Select

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

Select mocks base method.

type MockClickhouseMockRecorder

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

MockClickhouseMockRecorder is the mock recorder for MockClickhouse.

func (*MockClickhouseMockRecorder) AsyncInsert

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

AsyncInsert indicates an expected call of AsyncInsert.

func (*MockClickhouseMockRecorder) Exec

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

Exec indicates an expected call of Exec.

func (*MockClickhouseMockRecorder) HealthCheck

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

HealthCheck indicates an expected call of HealthCheck.

func (*MockClickhouseMockRecorder) Select

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

Select indicates an expected call of Select.

type MockPubSub

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

MockPubSub is a mock of PubSub interface.

func NewMockPubSub

func NewMockPubSub(ctrl *gomock.Controller) *MockPubSub

NewMockPubSub creates a new mock instance.

func (*MockPubSub) CreateTopic

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

CreateTopic mocks base method.

func (*MockPubSub) DeleteTopic

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

DeleteTopic mocks base method.

func (*MockPubSub) EXPECT

func (m *MockPubSub) EXPECT() *MockPubSubMockRecorder

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

type MockPubSubMockRecorder

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

MockPubSubMockRecorder is the mock recorder for MockPubSub.

func (*MockPubSubMockRecorder) CreateTopic

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

CreateTopic indicates an expected call of CreateTopic.

func (*MockPubSubMockRecorder) DeleteTopic

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

DeleteTopic indicates an expected call of DeleteTopic.

type MockRedis

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

MockRedis is a mock of Redis interface.

func NewMockRedis

func NewMockRedis(ctrl *gomock.Controller) *MockRedis

NewMockRedis creates a new mock instance.

func (*MockRedis) Del

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

Del mocks base method.

func (*MockRedis) EXPECT

func (m *MockRedis) EXPECT() *MockRedisMockRecorder

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

func (*MockRedis) Get

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

Get mocks base method.

func (*MockRedis) Rename

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

Rename mocks base method.

func (*MockRedis) Set

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

Set mocks base method.

type MockRedisMockRecorder

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

MockRedisMockRecorder is the mock recorder for MockRedis.

func (*MockRedisMockRecorder) Del

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

Del indicates an expected call of Del.

func (*MockRedisMockRecorder) Get

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

Get indicates an expected call of Get.

func (*MockRedisMockRecorder) Rename

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

Rename indicates an expected call of Rename.

func (*MockRedisMockRecorder) Set

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

Set indicates an expected call of Set.

type MockSQL

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

MockSQL is a mock of SQL interface.

func NewMockSQL

func NewMockSQL(ctrl *gomock.Controller) *MockSQL

NewMockSQL creates a new mock instance.

func (*MockSQL) EXPECT

func (m *MockSQL) EXPECT() *MockSQLMockRecorder

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

func (*MockSQL) Exec

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

Exec mocks base method.

func (*MockSQL) ExecContext

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

ExecContext mocks base method.

func (*MockSQL) Query

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

Query mocks base method.

func (*MockSQL) QueryRow

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

QueryRow mocks base method.

func (*MockSQL) QueryRowContext

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

QueryRowContext mocks base method.

type MockSQLMockRecorder

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

MockSQLMockRecorder is the mock recorder for MockSQL.

func (*MockSQLMockRecorder) Exec

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

Exec indicates an expected call of Exec.

func (*MockSQLMockRecorder) ExecContext

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

ExecContext indicates an expected call of ExecContext.

func (*MockSQLMockRecorder) Query

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

Query indicates an expected call of Query.

func (*MockSQLMockRecorder) QueryRow

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

QueryRow indicates an expected call of QueryRow.

func (*MockSQLMockRecorder) QueryRowContext

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

QueryRowContext indicates an expected call of QueryRowContext.

type Mockmigrator

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

Mockmigrator is a mock of migrator interface.

func NewMockmigrator

func NewMockmigrator(ctrl *gomock.Controller) *Mockmigrator

NewMockmigrator creates a new mock instance.

func (*Mockmigrator) EXPECT

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

type MockmigratorMockRecorder

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

MockmigratorMockRecorder is the mock recorder for Mockmigrator.

type PubSub

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

type Redis

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

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