Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { General GeneralConfig `mapstructure:"general"` WorkerConfig WorkerConfig `mapstructure:"worker"` Logging logtypes.LoggingConfig `mapstructure:"logging"` }
AppConfig is the structure representation of configuration from `config.yaml` file
func LoadAppConfig ¶
LoadAppConfig load the configuration from `config.yaml` file within the specified application's home directory
func (AppConfig) PrintOptions ¶
func (c AppConfig) PrintOptions()
PrintOptions prints the configuration in the `config.yaml` in a nice way, human-readable
type AppContext ¶
AppContext hold the working context of the application entirely. It contains application configuration, logger,...
func NewAppContext ¶
func NewAppContext(conf *AppConfig) *AppContext
NewAppContext inits `AppContext` with needed information to be stored within and return it
type ChainConfig ¶
type ChainConfig struct { ChainName string `mapstructure:"chain-name"` ChainId string `mapstructure:"chain-id"` Disable bool `mapstructure:"disable,omitempty"` Priority bool `mapstructure:"priority,omitempty"` RPCs []string `mapstructure:"rpc"` Validators map[string]*ChainValidatorConfig `mapstructure:"validators"` HealthCheckRPC []string `mapstructure:"health-check-rpc,omitempty"` }
func (ChainConfig) Validate ¶
func (c ChainConfig) Validate() error
type ChainValidatorConfig ¶
type ChainsConfig ¶
type ChainsConfig []ChainConfig
func LoadChainsConfig ¶
func LoadChainsConfig(homeDir string) (ChainsConfig, error)
LoadChainsConfig load the configuration from `chain.*.yaml` file within the specified application's home directory
func (ChainsConfig) PrintOptions ¶ added in v1.1.1
func (c ChainsConfig) PrintOptions()
func (ChainsConfig) SortByPriority ¶
func (c ChainsConfig) SortByPriority() ChainsConfig
func (ChainsConfig) Validate ¶
func (c ChainsConfig) Validate(usersConfig *UsersConfig) error
type GeneralConfig ¶
type UserRecord ¶
type UserRecord struct { Identity string `mapstructure:"-"` Root bool `mapstructure:"root"` TelegramConfig *UserTelegramConfig `mapstructure:"telegram,omitempty"` }
func (UserRecord) Validate ¶
func (r UserRecord) Validate() error
type UserRecords ¶
type UserRecords []UserRecord
func (UserRecords) Validate ¶
func (r UserRecords) Validate() error
type UserTelegramConfig ¶
type UserTelegramConfig struct { Username string `mapstructure:"username"` UserId int64 `mapstructure:"id"` Token string `mapstructure:"token"` // token used to send message to this user }
func (*UserTelegramConfig) IsEmptyOrIncompleteConfig ¶
func (c *UserTelegramConfig) IsEmptyOrIncompleteConfig() bool
type UsersConfig ¶
type UsersConfig struct {
Users map[string]UserRecord `mapstructure:"users"`
}
func LoadUsersConfig ¶
func LoadUsersConfig(homeDir string) (*UsersConfig, error)
LoadUsersConfig load the configuration from `users.yaml` file within the specified application's home directory
func (UsersConfig) PrintOptions ¶ added in v1.1.1
func (c UsersConfig) PrintOptions()
func (UsersConfig) ToUserRecords ¶
func (c UsersConfig) ToUserRecords() UserRecords
type WorkerConfig ¶
type WorkerConfig struct {
HealthCheckCount int `mapstructure:"health-check-count"`
}