flags

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Flag names
	FlagUnixSocketAddress           = "unix-socket-address"
	FlagPanicOnDaemonFailureEnabled = "panic-on-daemon-failure-enabled"
	FlagMaxDaemonUnhealthySeconds   = "max-daemon-unhealthy-seconds"

	FlagPriceDaemonEnabled     = "price-daemon-enabled"
	FlagPriceDaemonLoopDelayMs = "price-daemon-loop-delay-ms"

	FlagReporterDaemonEnabled = "reporter-daemon-enabled"
	FlagKeyringBackend        = "keyring-backend"
)

List of CLI flags for Server and Client.

Variables

This section is empty.

Functions

func AddDaemonFlagsToCmd

func AddDaemonFlagsToCmd(
	cmd *cobra.Command,
)

AddDaemonFlagsToCmd adds the required flags to instantiate a server and client for price updates. These flags should be applied to the `start` command LAYER Cosmos application. E.g. `layerd start --price-daemon-enabled=true --unix-socket-address $(unix_socket_address)`

Types

type DaemonFlags

type DaemonFlags struct {
	Shared   SharedFlags
	Price    PriceFlags
	Reporter ReporterFlags
}

DaemonFlags contains the collected configuration flags for all daemons.

func GetDaemonFlagValuesFromOptions

func GetDaemonFlagValuesFromOptions(
	appOpts servertypes.AppOptions,
) DaemonFlags

GetDaemonFlagValuesFromOptions gets all daemon flag values from the `AppOptions` struct.

func GetDefaultDaemonFlags

func GetDefaultDaemonFlags() DaemonFlags

GetDefaultDaemonFlags returns the default values for the Daemon Flags using a singleton pattern.

type PriceFlags

type PriceFlags struct {
	// Enabled toggles the price daemon on or off.
	Enabled bool
	// LoopDelayMs configures the update frequency of the price daemon.
	LoopDelayMs uint32
}

PriceFlags contains configuration flags for the Price Daemon.

type ReporterFlags

type ReporterFlags struct {
	// Enabled toggles the reporter daemon on or off.
	Enabled     bool
	AccountName string
}

ReporterFlags contains configuration flags for the Reporter Daemon.

type SharedFlags

type SharedFlags struct {
	// SocketAddress is the location of the unix socket to communicate with the daemon gRPC service.
	SocketAddress string
	// PanicOnDaemonFailureEnabled toggles whether the daemon should panic on failure.
	PanicOnDaemonFailureEnabled bool
	// MaxDaemonUnhealthySeconds is the maximum allowable duration for which a daemon can be unhealthy.
	MaxDaemonUnhealthySeconds uint32
}

Shared flags contains configuration flags shared by all daemons.

Jump to

Keyboard shortcuts

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