config

package
v0.0.0-...-9ccab3c Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(ctx context.Context, filename string, log *log.Logger) (*GlobalConfig, []*AccountConfig, r.Router, error)

Types

type AccountConfig

type AccountConfig struct {
	Address string
	MinCoin sdk.Coin

	TopUpAmount sdk.Coin

	RateLimit time.Duration
}

type GlobalConfig

type GlobalConfig struct {
	Mnemonic    string
	RunInterval time.Duration
}

type UserAccountConfig

type UserAccountConfig struct {
	// Where to find data
	ChainID string `yaml:"chainID"`
	Grpc    string `yaml:"grpc"`

	// What address do I care about
	Address   string      `yaml:"address"`
	Denom     string      `yaml:"denom"`
	MinAmount json.Number `yaml:"minAmount"`

	// Payout configurations
	TopUpAmount      json.Number `yaml:"topUpAmount"`
	RateLimitSeconds int         `yaml:"rateLimitSeconds"`
}

UserAccountConfig is configuration for an account to monitor.

type UserConfig

type UserConfig struct {
	// Account that will pay us
	Mnemonic string `yaml:"mnemonic"`

	// How often the check is run
	RunIntervalSeconds int `yaml:"runIntervalSeconds"`

	// Accounts to manage
	Accounts []UserAccountConfig `yaml:"userAccountConfig"`
}

UserConfig is the top level config provided by a user of paymaaster

Jump to

Keyboard shortcuts

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