Documentation
¶
Overview ¶
Package onboarding provides the public API for initializing the onboarding component. This package exposes factory functions that allow other components to instantiate the onboarding service while keeping internal implementation details private.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitService
deprecated
func InitService() mbootstrap.Service
InitService initializes the onboarding service.
Deprecated: Use InitServiceOrError for proper error handling. This function panics on initialization errors.
func InitServiceOrError ¶
func InitServiceOrError() (mbootstrap.Service, error)
InitServiceOrError initializes the onboarding service with explicit error handling. This is the recommended way to initialize the service as it allows callers to handle initialization errors gracefully instead of panicking.
Types ¶
type OnboardingService ¶
type OnboardingService interface {
mbootstrap.Service
// GetRouteRegistrar returns a function that registers onboarding routes to a Fiber app.
// This is used by the unified ledger server to consolidate all routes on a single port.
GetRouteRegistrar() func(*fiber.App)
// GetMetadataIndexPort returns the metadata index port for use by other modules.
// This allows direct in-process calls for metadata index operations when running in unified mode.
GetMetadataIndexPort() mbootstrap.MetadataIndexRepository
}
OnboardingService extends mbootstrap.Service with onboarding-specific methods. Use this interface when you need access to route registration for unified ledger mode.
func InitServiceWithOptionsOrError ¶
func InitServiceWithOptionsOrError(opts *Options) (OnboardingService, error)
InitServiceWithOptionsOrError initializes the onboarding service with custom options and explicit error handling. Use this when running in unified ledger mode. Returns OnboardingService which provides access to route registration.
type Options ¶
type Options struct {
// Logger allows callers to provide a pre-configured logger, avoiding multiple
// initializations when composing components (e.g. unified ledger).
Logger libLog.Logger
// UnifiedMode indicates the service is running as part of the unified ledger.
// When true, all ports must be provided for in-process communication.
// When false (or Options is nil), uses gRPC adapters for remote communication.
UnifiedMode bool
// BalancePort enables direct in-process communication with the transaction module.
// Required when UnifiedMode is true. The BalancePort is typically the
// transaction.UseCase which implements mbootstrap.BalancePort.
BalancePort mbootstrap.BalancePort
}
Options configures the onboarding service initialization behavior. It controls whether the service runs in unified mode (part of the ledger monolith) or standalone mode (separate microservice).
In unified mode, the onboarding service communicates with other modules (such as the transaction module) via direct in-process calls instead of gRPC. This improves performance by avoiding network overhead.
Example usage in unified mode:
opts := &onboarding.Options{
UnifiedMode: true,
BalancePort: transactionUseCase, // implements mbootstrap.BalancePort
}
service, err := onboarding.InitServiceWithOptionsOrError(opts)
Example usage in standalone mode:
// Pass nil or use InitService() directly for gRPC-based communication service := onboarding.InitService()
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api Code generated by swaggo/swag.
|
Package api Code generated by swaggo/swag. |
|
cmd
|
|
|
app
command
|
|
|
internal
|
|
|
adapters/grpc/out
Package out is a generated GoMock package.
|
Package out is a generated GoMock package. |
|
adapters/mongodb
Package mongodb is a generated GoMock package.
|
Package mongodb is a generated GoMock package. |
|
adapters/postgres/account
Package account is a generated GoMock package.
|
Package account is a generated GoMock package. |
|
adapters/postgres/accounttype
Package accounttype is a generated GoMock package.
|
Package accounttype is a generated GoMock package. |
|
adapters/postgres/asset
Package asset is a generated GoMock package.
|
Package asset is a generated GoMock package. |
|
adapters/postgres/ledger
Package ledger is a generated GoMock package.
|
Package ledger is a generated GoMock package. |
|
adapters/postgres/organization
Package organization is a generated GoMock package.
|
Package organization is a generated GoMock package. |
|
adapters/postgres/portfolio
Package portfolio is a generated GoMock package.
|
Package portfolio is a generated GoMock package. |
|
adapters/postgres/segment
Package segment is a generated GoMock package.
|
Package segment is a generated GoMock package. |
|
adapters/redis
Package redis is a generated GoMock package.
|
Package redis is a generated GoMock package. |