mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package cmd
|
|
|
|
import (
|
|
"github.com/formancehq/ledger/internal/engine"
|
|
driver "github.com/formancehq/ledger/internal/storage/driver"
|
|
"github.com/formancehq/stack/libs/go-libs/auth"
|
|
"github.com/formancehq/stack/libs/go-libs/otlp/otlpmetrics"
|
|
"github.com/formancehq/stack/libs/go-libs/otlp/otlptraces"
|
|
"github.com/formancehq/stack/libs/go-libs/publish"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
const ServiceName = "ledger"
|
|
|
|
func resolveOptions(cmd *cobra.Command, userOptions ...fx.Option) []fx.Option {
|
|
options := make([]fx.Option, 0)
|
|
options = append(options, fx.NopLogger)
|
|
|
|
options = append(options,
|
|
publish.CLIPublisherModule(ServiceName),
|
|
otlptraces.CLITracesModule(),
|
|
otlpmetrics.CLIMetricsModule(),
|
|
auth.CLIAuthModule(),
|
|
driver.CLIModule(cmd),
|
|
engine.Module(engine.Configuration{
|
|
NumscriptCache: engine.NumscriptCacheConfiguration{
|
|
MaxCount: viper.GetInt(numscriptCacheMaxCountFlag),
|
|
},
|
|
LedgerBatchSize: viper.GetInt(ledgerBatchSizeFlag),
|
|
}),
|
|
)
|
|
|
|
return append(options, userOptions...)
|
|
}
|