Documentation
¶
Overview ¶
Package config implements the logic to read the config file (either default or user-supplied) and unmarshal it a struct for developer convenience.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct { Server *Server `mapstructure:"server"` BasePath string `mapstructure:"base_path"` RegisterVersions []string `mapstructure:"register_versions"` }
Api struct is used to store the contents of the 'api' property from the parsed config file.
type Config ¶
type Config struct { System *System `mapstructure:"system"` Api *Api `mapstructure:"api"` FaultDetectorConfig *FaultDetectorConfig `mapstructure:"fault_detector"` Notification *Notification `mapstructure:"notification"` }
Config struct is used to store the contents of the parsed config file. The properties (sub-properties) should map on-to-one with the config file.
type FaultDetectorConfig ¶
type FaultDetectorConfig struct { L1RPCEndpoint string `mapstructure:"l1_rpc_endpoint"` L2RPCEndpoint string `mapstructure:"l2_rpc_endpoint"` StartBatchIndex int64 `mapstructure:"start_batch_index"` L2OutputOracleContractAddress string `mapstructure:"l2_output_oracle_contract_address"` }
FaultDetector struct is used to store the contents of the 'fault_detector' property from the parsed config file.
func (*FaultDetectorConfig) Validate ¶
func (c *FaultDetectorConfig) Validate() error
Validate runs validations against an instance of the FaultDetector struct and returns an error when applicable.
type Notification ¶
type Notification struct { Slack *SlackConfig `mapstructure:"slack"` Enable bool `mapstructure:"enable"` }
Notification struct is used to store notification configurations from the parsed config file.
func (*Notification) Validate ¶
func (c *Notification) Validate() error
Validate runs validations against an instance of the Notification struct and returns an error when applicable.
type Server ¶
Server struct is used to store the contents of the 'api.server' sub-property from the parsed config file.
type SlackConfig ¶
type SlackConfig struct {
ChannelID string `mapstructure:"channel_id"`
}
SlackConfig struct is used to store slack configurations from the parsed config file.