Documentation
¶
Overview ¶
Package mbootstrap is a generated GoMock package.
Package mbootstrap provides shared interfaces for bootstrapping Midaz components. This package enables composition of multiple components (onboarding, transaction) into a unified service (ledger) while maintaining encapsulation of internal implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalancePort ¶
type BalancePort interface {
// CreateBalanceSync creates a balance synchronously and returns the created balance.
// Named "Sync" to distinguish from the async queue-based CreateBalance in transaction module.
CreateBalanceSync(ctx context.Context, input mmodel.CreateBalanceInput) (*mmodel.Balance, error)
// DeleteAllBalancesByAccountID deletes all balances for a given account.
DeleteAllBalancesByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID) error
}
BalancePort defines the interface for balance operations. This is a transport-agnostic "port" that abstracts how the onboarding module communicates with the transaction module.
This interface is implemented by:
- transaction.UseCase: Direct implementation (unified ledger mode)
- GRPCBalanceAdapter: Network calls via gRPC (separate services mode)
The onboarding module's UseCase depends on this port, allowing it to work with either implementation without knowing the underlying transport mechanism.
In unified ledger mode, the transaction.UseCase is passed directly to onboarding, eliminating the need for intermediate adapters and enabling zero-overhead in-process calls.
type MockBalancePort ¶
type MockBalancePort struct {
// contains filtered or unexported fields
}
MockBalancePort is a mock of BalancePort interface.
func NewMockBalancePort ¶
func NewMockBalancePort(ctrl *gomock.Controller) *MockBalancePort
NewMockBalancePort creates a new mock instance.
func (*MockBalancePort) CreateBalanceSync ¶
func (m *MockBalancePort) CreateBalanceSync(arg0 context.Context, arg1 mmodel.CreateBalanceInput) (*mmodel.Balance, error)
CreateBalanceSync mocks base method.
func (*MockBalancePort) DeleteAllBalancesByAccountID ¶
func (m *MockBalancePort) DeleteAllBalancesByAccountID(arg0 context.Context, arg1, arg2, arg3 uuid.UUID) error
DeleteAllBalancesByAccountID mocks base method.
func (*MockBalancePort) EXPECT ¶
func (m *MockBalancePort) EXPECT() *MockBalancePortMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBalancePortMockRecorder ¶
type MockBalancePortMockRecorder struct {
// contains filtered or unexported fields
}
MockBalancePortMockRecorder is the mock recorder for MockBalancePort.
func (*MockBalancePortMockRecorder) CreateBalanceSync ¶
func (mr *MockBalancePortMockRecorder) CreateBalanceSync(arg0, arg1 any) *gomock.Call
CreateBalanceSync indicates an expected call of CreateBalanceSync.
func (*MockBalancePortMockRecorder) DeleteAllBalancesByAccountID ¶
func (mr *MockBalancePortMockRecorder) DeleteAllBalancesByAccountID(arg0, arg1, arg2, arg3 any) *gomock.Call
DeleteAllBalancesByAccountID indicates an expected call of DeleteAllBalancesByAccountID.
type Runnable ¶
type Runnable interface {
Run(l *libCommons.Launcher) error
}
Runnable represents a component that can be run by the launcher. This interface is compatible with libCommons.NewLauncher's RunApp function.
type RunnableConfig ¶
RunnableConfig pairs a runnable with its name for the launcher.
type Service ¶
type Service interface {
// GetRunnables returns all runnable components of this service.
// These will be passed to libCommons.NewLauncher for execution.
GetRunnables() []RunnableConfig
}
Service represents a bootstrapped service that can be composed into a unified deployment. Each component (onboarding, transaction) implements this interface to expose its runnable components for composition.