remote

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config - remote config struct

func NewConfig

func NewConfig(client Fetcher) (*Config, error)

NewConfig - new remote config instance

func (*Config) Get

func (rc *Config) Get(key string) interface{}

Get returns stored remote config value as-is.

func (*Config) GetBigInt

func (rc *Config) GetBigInt(key string) *big.Int

GetBigInt returns config value as big.Int.

func (*Config) GetBigIntByFlag

func (rc *Config) GetBigIntByFlag(flag cli.StringFlag) *big.Int

GetBigIntByFlag shorthand for getting and parsing a configuration value for cli.StringFlag that's a big.Int.

func (*Config) GetBool

func (rc *Config) GetBool(key string) bool

GetBool returns config value as bool.

func (*Config) GetBoolByFlag

func (rc *Config) GetBoolByFlag(flag cli.BoolFlag) bool

GetBoolByFlag shorthand for getting current configuration value for cli.BoolFlag.

func (*Config) GetHermesID

func (rc *Config) GetHermesID() (string, error)

GetHermesID returns the current hermes id.

func (*Config) GetInt64

func (rc *Config) GetInt64(key string) int64

GetInt64 returns config value as int64.

func (*Config) GetInt64ByFlag

func (rc *Config) GetInt64ByFlag(flag cli.Int64Flag) int64

GetInt64ByFlag shorthand for getting and parsing a configuration value for cli.StringFlag that's a int64.

func (*Config) GetString

func (rc *Config) GetString(key string) string

GetString returns config value as string.

func (*Config) GetStringByFlag

func (rc *Config) GetStringByFlag(flag cli.StringFlag) string

GetStringByFlag shorthand for getting current configuration value for cli.BoolFlag.

func (*Config) GetStringSlice

func (rc *Config) GetStringSlice(key string) []string

GetStringSlice returns config value as []string.

func (*Config) GetStringSliceByFlag

func (rc *Config) GetStringSliceByFlag(flag cli.StringSliceFlag) []string

GetStringSliceByFlag shorthand for getting and parsing a configuration value for cli.StringFlag that's a []string.

func (*Config) RefreshRemoteConfig

func (rc *Config) RefreshRemoteConfig() error

RefreshRemoteConfig - will fetch latest config

type Fetcher

type Fetcher interface {
	FetchConfig() (map[string]interface{}, error)
}

Fetcher interface represents anything that is able to fetch a config.

Jump to

Keyboard shortcuts

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