Documentation ¶
Index ¶
- func ConfigCommand(_ *args) *cobra.Command
- func DownloadConfigCommand(arg *args) *cobra.Command
- func InitCommands(build, version string) (*cobra.Command, error)
- func ServerCommand(arg *args) *cobra.Command
- func UploadConfigCommand(arg *args) *cobra.Command
- func VerifyConfigCommand(arg *args) *cobra.Command
- type Config
- type OtelConfig
- type PrometheusConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigCommand ¶ added in v0.1.0
ConfigCommand is a top-level cobra.Command for config relation operations for Deriv API. You can use its sub commands as `config [sub command]`
func DownloadConfigCommand ¶ added in v0.6.0
DownloadConfigCommand creates a new cobra.Command for downloading the config. It takes arg of type *args which contains the necessary parameters for the command. It returns a *cobra.Command that can be executed to download the config. It returns an error if the logger initialization fails, the output path is not provided, or if there is an error during the config initialization or download process.
func InitCommands ¶
InitCommands initializes and returns the root command for the Backend for Frontend (BFF) service. It sets up the command structure and adds subcommands, including setting up persistent flags. It returns a pointer to a cobra.Command which represents the root command.
func ServerCommand ¶
ServerCommand creates a new cobra.Command to start the BFF server for Deriv API. It takes cfgPath of type *string which is the path to the configuration file. It returns a pointer to a cobra.Command which can be executed to start the server. It returns an error if the logger initialization fails, the configuration cannot be loaded, or the server fails to run.
func UploadConfigCommand ¶ added in v0.3.0
UploadConfigCommand creates a new cobra.Command to load the calls config for Deriv API. The config is loaded and then pushed to etcd for watching changes. It can take cfgPath of type *string which is the path to the configuration file as an argument. It also takes the etcd host URL and dial timeout in seconds as argument It returns a pointer to a cobra.Command which can be executed to load the config. It returns an error if the logger initialization fails, the configuration cannot be loaded, or there is error thrown by etcd.
func VerifyConfigCommand ¶ added in v0.4.0
VerifyConfigCommand creates a new cobra.Command to verify the configuration for correctness. It takes arg of type *args which contains the necessary parameters for the command. It returns a pointer to a cobra.Command which can be executed to perform the verification. It returns an error if initializing the logger or configuration fails, or if the configuration verification fails.
Types ¶
type OtelConfig ¶ added in v0.3.0
type OtelConfig struct {
Prometheus *PrometheusConfig `mapstructure:"prometheus"`
}