config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package config enables .yaml files to be passed and parsed to specify indexer behavior

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SynapseBridgeAddress is the address of the SynapseBridge.sol contract
	SynapseBridgeAddress string `yaml:"synapse_bridge_address"`
	// BridgeConfigV3Address is the address of the BridgeConfigV3.sol contract
	BridgeConfigV3Address string `yaml:"bridge_config_v3_address"`
	// SwapFlashLoanAddress is the address of the SwapFlashLoan.sol contract
	SwapFlashLoanAddress string `yaml:"swap_flash_loan_address"`
}

Config holds the config for the explorer.

func DecodeConfig

func DecodeConfig(filePath string) (cfg Config, err error)

DecodeConfig parses in a config from a file.

func (Config) Encode

func (c Config) Encode() ([]byte, error)

Encode gets the encoded config.toml file.

func (*Config) IsValid

func (c *Config) IsValid(ctx context.Context) (ok bool, err error)

IsValid makes sure the config is valid. This is done by calling IsValid() on each submodule. If any method returns an error that is returned here and the entirety of IsValid returns false. Any warnings are logged by the submodules respective loggers. TODO: add more checks.

Jump to

Keyboard shortcuts

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