Documentation ¶
Index ¶
- Constants
- Variables
- func GetSecret(secretName, region string) (string, error)
- func InitAlert(cfg *AlertConfig)
- func InitLogger(config LogConfig)
- func PrepareDB(config *Config) (*gorm.DB, error)
- func SendPagerDutyAlert(detail string, dedupKey string)
- func SendTelegramMessage(msg string)
- type AdminConfig
- type AlertConfig
- type ChainConfig
- type Config
- type DBConfig
- type LogConfig
- type TgAlerter
Constants ¶
View Source
const ( KeyTypeMnemonic = "mnemonic" KeyTypeAWSMnemonic = "aws_mnemonic" )
View Source
const ( IncidentDedupKeyBlockTimeout = "block_timeout" IncidentDedupKeyRelayError = "relay_error" )
Variables ¶
View Source
var ( // Logger instance for quick declarative logging levels Logger = logging.MustGetLogger("deputy") SdkLogger = &sdkLogger{} )
Functions ¶
func InitAlert ¶
func InitAlert(cfg *AlertConfig)
func SendPagerDutyAlert ¶
func SendTelegramMessage ¶
func SendTelegramMessage(msg string)
SendTelegramMessage sends message to telegram group
Types ¶
type AdminConfig ¶
type AdminConfig struct {
ListenAddr string `json:"listen_addr"`
}
type AlertConfig ¶
type AlertConfig struct { Moniker string `json:"moniker"` TelegramBotId string `json:"telegram_bot_id"` TelegramChatId string `json:"telegram_chat_id"` PagerDutyAuthToken string `json:"pager_duty_auth_token"` BlockUpdateTimeOut int64 `json:"block_update_time_out"` PackageDelayAlertThreshold int64 `json:"package_delay_alert_threshold"` }
func (*AlertConfig) Validate ¶
func (cfg *AlertConfig) Validate()
type ChainConfig ¶
type ChainConfig struct { ASCStartHeight int64 `json:"asc_start_height"` ASCProviders []string `json:"asc_providers"` ASCConfirmNum int64 `json:"asc_confirm_num"` ASCChainId uint16 `json:"asc_chain_id"` ASCCrossChainContractAddress ethcmm.Address `json:"asc_cross_chain_contract_address"` AFCRpcAddrs []string `json:"afc_rpc_addrs"` AFCMnemonic string `json:"afc_mnemonic"` AFCKeyType string `json:"afc_key_type"` AFCAWSRegion string `json:"afc_aws_region"` AFCAWSSecretName string `json:"afc_aws_secret_name"` RelayInterval int64 `json:"relay_interval"` }
func (*ChainConfig) Validate ¶
func (cfg *ChainConfig) Validate()
type Config ¶
type Config struct { DBConfig *DBConfig `json:"db_config"` ChainConfig *ChainConfig `json:"chain_config"` LogConfig *LogConfig `json:"log_config"` AlertConfig *AlertConfig `json:"alert_config"` AdminConfig *AdminConfig `json:"admin_config"` }
func GetTestConfig ¶
func GetTestConfig() *Config
func ParseConfigFromFile ¶
ParseConfigFromFile returns the config from json file
func ParseConfigFromJson ¶
ParseConfigFromJson returns the config from json string
type LogConfig ¶
type LogConfig struct { Level string `json:"level"` Filename string `json:"filename"` MaxFileSizeInMB int `json:"max_file_size_in_mb"` MaxBackupsOfLogFiles int `json:"max_backups_of_log_files"` MaxAgeToRetainLogFilesInDays int `json:"max_age_to_retain_log_files_in_days"` UseConsoleLogger bool `json:"use_console_logger"` UseFileLogger bool `json:"use_file_logger"` Compress bool `json:"compress"` }
Click to show internal directories.
Click to hide internal directories.