cmd

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigCommand added in v0.1.0

func ConfigCommand(_ *args) *cobra.Command

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

func DownloadConfigCommand(arg *args) *cobra.Command

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

func InitCommands(build, version string) (*cobra.Command, error)

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

func ServerCommand(arg *args) *cobra.Command

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

func UploadConfigCommand(arg *args) *cobra.Command

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

func VerifyConfigCommand(arg *args) *cobra.Command

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 Config added in v0.3.0

type Config struct {
	Otel      OtelConfig    `mapstructure:"otel"`
	APISource source.Config `mapstructure:"api_source"`
	Deriv     deriv.Config  `mapstructure:"deriv"`
	Server    api.Config    `mapstructure:"server"`
}

type OtelConfig added in v0.3.0

type OtelConfig struct {
	Prometheus *PrometheusConfig `mapstructure:"prometheus"`
}

type PrometheusConfig added in v0.3.0

type PrometheusConfig struct {
	Listen string `mapstructure:"listen"`
	Path   string `mapstructure:"path"`
}

Jump to

Keyboard shortcuts

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