repo

package
v0.0.0-...-0c3fea9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogsDirName = "logs"

	NodeManagerContractAddr = "0x0000000000000000000000000000000000001001"
)

Variables

This section is empty.

Functions

func CheckWritable

func CheckWritable(dir string) error

func Exist

func Exist(path string) bool

Exist check if the file with the given path exits.

func LoadRepoRootFromEnv

func LoadRepoRootFromEnv(repoRoot string) (string, error)

func MarshalConfig

func MarshalConfig(config any) (string, error)

Types

type Config

type Config struct {
	RepoRoot  string    `mapstructure:"-" toml:"-"`
	DialUrl   string    `mapstructure:"dial_url" toml:"dial_url"`
	AxiomPath string    `mapstructure:"axiom_path" toml:"axiom_path"`
	Log       Log       `mapstructure:"log" toml:"log"`
	Subscribe Subscribe `mapstructure:"subscribe" toml:"subscribe"`
}

func DefaultConfig

func DefaultConfig(repoRoot string) *Config

type Log

type Log struct {
	Level        string        `mapstructure:"level" toml:"level"`
	Filename     string        `mapstructure:"filename" toml:"filename"`
	ReportCaller bool          `mapstructure:"report_caller" toml:"report_caller"`
	MaxAge       time.Duration `mapstructure:"max_age" toml:"max_age"`
	RotationTime time.Duration `mapstructure:"rotation_time" toml:"rotation_time"`
}

type Repo

type Repo struct {
	Config *Config
}

func Load

func Load(repoRoot string) (*Repo, error)

func (*Repo) Flush

func (r *Repo) Flush() error

type Subscribe

type Subscribe struct {
	// beginning of the queried range, 1 means genesis block
	FromBlock uint64 `mapstructure:"from_block" toml:"from_block"`
	// end of the range, 0 means latest block
	ToBlock   uint64   `mapstructure:"to_block" toml:"to_block"`
	Addresses []string `mapstructure:"addresses" toml:"addresses"`
	// Examples:
	// {} or nil          matches any topic list
	// {{A}}              matches topic A in first position
	// {{}, {B}}          matches any topic in first position AND B in second position
	// {{A}, {B}}         matches topic A in first position AND B in second position
	// {{A, B}, {C, D}}   matches topic (A OR B) in first position AND (C OR D) in second position
	Topics [][]string `mapstructure:"topics" toml:"topics"`
}

Jump to

Keyboard shortcuts

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