datasource

package
v0.0.0-...-4877f23 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package datasource is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrDBConnectionFailed

func ErrDBConnectionFailed(errs ...error) error

Types

type Connection

type Connection[T StoreConnectionTypes] interface {
	Connect() (T, error)
	Close()
	Context() Context
}

func NewConnection

func NewConnection(context Context, dialector gorm.Dialector, opts ...gorm.Option) Connection[*gorm.DB]

type Context

type Context interface {
	Url() string
	Server() string
	Service() string
}

func NewContext

func NewContext(url string, username string, password string, server string, service string) Context

type MockConnection

type MockConnection[T StoreConnectionTypes] struct {
	// contains filtered or unexported fields
}

MockConnection is a mock of Connection interface.

func NewMockConnection

func NewMockConnection[T StoreConnectionTypes](ctrl *gomock.Controller) *MockConnection[T]

NewMockConnection creates a new mock instance.

func (*MockConnection[T]) Close

func (m *MockConnection[T]) Close()

Close mocks base method.

func (*MockConnection[T]) Connect

func (m *MockConnection[T]) Connect() (T, error)

Connect mocks base method.

func (*MockConnection[T]) Context

func (m *MockConnection[T]) Context() Context

Context mocks base method.

func (*MockConnection[T]) EXPECT

func (m *MockConnection[T]) EXPECT() *MockConnectionMockRecorder[T]

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

type MockConnectionMockRecorder

type MockConnectionMockRecorder[T StoreConnectionTypes] struct {
	// contains filtered or unexported fields
}

MockConnectionMockRecorder is the mock recorder for MockConnection.

func (*MockConnectionMockRecorder[T]) Close

func (mr *MockConnectionMockRecorder[T]) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockConnectionMockRecorder[T]) Connect

func (mr *MockConnectionMockRecorder[T]) Connect() *gomock.Call

Connect indicates an expected call of Connect.

func (*MockConnectionMockRecorder[T]) Context

func (mr *MockConnectionMockRecorder[T]) Context() *gomock.Call

Context indicates an expected call of Context.

type MockContext

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

MockContext is a mock of Context interface.

func NewMockContext

func NewMockContext(ctrl *gomock.Controller) *MockContext

NewMockContext creates a new mock instance.

func (*MockContext) EXPECT

func (m *MockContext) EXPECT() *MockContextMockRecorder

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

func (*MockContext) Server

func (m *MockContext) Server() string

Server mocks base method.

func (*MockContext) Service

func (m *MockContext) Service() string

Service mocks base method.

func (*MockContext) Url

func (m *MockContext) Url() string

Url mocks base method.

type MockContextMockRecorder

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

MockContextMockRecorder is the mock recorder for MockContext.

func (*MockContextMockRecorder) Server

func (mr *MockContextMockRecorder) Server() *gomock.Call

Server indicates an expected call of Server.

func (*MockContextMockRecorder) Service

func (mr *MockContextMockRecorder) Service() *gomock.Call

Service indicates an expected call of Service.

func (*MockContextMockRecorder) Url

func (mr *MockContextMockRecorder) Url() *gomock.Call

Url indicates an expected call of Url.

type MockTransactionHandler

type MockTransactionHandler[T StoreConnectionTypes] struct {
	// contains filtered or unexported fields
}

MockTransactionHandler is a mock of TransactionHandler interface.

func NewMockTransactionHandler

func NewMockTransactionHandler[T StoreConnectionTypes](ctrl *gomock.Controller) *MockTransactionHandler[T]

NewMockTransactionHandler creates a new mock instance.

func (*MockTransactionHandler[T]) EXPECT

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

func (*MockTransactionHandler[T]) HandleTransaction

func (m *MockTransactionHandler[T]) HandleTransaction(ctx context.Context, fn TransactionHandlerFn[T]) error

HandleTransaction mocks base method.

type MockTransactionHandlerMockRecorder

type MockTransactionHandlerMockRecorder[T StoreConnectionTypes] struct {
	// contains filtered or unexported fields
}

MockTransactionHandlerMockRecorder is the mock recorder for MockTransactionHandler.

func (*MockTransactionHandlerMockRecorder[T]) HandleTransaction

func (mr *MockTransactionHandlerMockRecorder[T]) HandleTransaction(ctx, fn any) *gomock.Call

HandleTransaction indicates an expected call of HandleTransaction.

type StoreConnectionTypes

type StoreConnectionTypes interface {
	*gorm.DB | struct{}
}

type TransactionCtxKey

type TransactionCtxKey struct{}

type TransactionHandler

type TransactionHandler[T StoreConnectionTypes] interface {
	HandleTransaction(ctx context.Context, fn TransactionHandlerFn[T]) error
}

func NewOrmTransactionHandler

func NewOrmTransactionHandler(connection Connection[*gorm.DB]) TransactionHandler[*gorm.DB]

type TransactionHandlerFn

type TransactionHandlerFn[T StoreConnectionTypes] func(ctx context.Context, tx T) error

Jump to

Keyboard shortcuts

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