config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbConnectionString

func DbConnectionString(dbConfig Database) string

Types

type Client

type Client struct {
	IPCPath string
}

type Config

type Config struct {
	Database Database
	Client   Client
}

type ContractConfig

type ContractConfig struct {
	// Name for the transformer
	Name string

	// Ethereum network name; default "" is mainnet
	Network string

	// List of contract addresses (map to ensure no duplicates)
	Addresses map[string]bool

	// Map of contract address to abi
	// If an address has no associated abi the parser will attempt to fetch one from etherscan
	Abis map[string]string

	// Map of contract address to slice of events
	// Used to set which addresses to watch
	// If any events are listed in the slice only those will be watched
	// Otherwise all events in the contract ABI are watched
	Events map[string][]string

	// Map of contract address to slice of methods
	// If any methods are listed in the slice only those will be polled
	// Otherwise no methods will be polled
	Methods map[string][]string

	// Map of contract address to slice of event arguments to filter for
	// If arguments are provided then only events which emit those arguments are watched
	// Otherwise arguments are not filtered on events
	EventArgs map[string][]string

	// Map of contract address to slice of method arguments to limit polling to
	// If arguments are provided then only those arguments are allowed as arguments in method polling
	// Otherwise any argument of the right type seen emitted from events at that contract will be used in method polling
	MethodArgs map[string][]string

	// Map of contract address to their starting block
	StartingBlocks map[string]int64

	// Map of contract address to whether or not to pipe method polling results forward into subsequent method calls
	Piping map[string]bool
}

Config struct for generic contract transformer

func (*ContractConfig) PrepConfig

func (contractConfig *ContractConfig) PrepConfig()

type Database

type Database struct {
	Hostname string
	Name     string
	User     string
	Password string
	Port     int
}

type Plugin

type Plugin struct {
	Transformers map[string]Transformer
	FilePath     string
	FileName     string
	Save         bool
	Home         string
}

func (*Plugin) GetMigrationsPaths

func (pluginConfig *Plugin) GetMigrationsPaths() ([]string, error)

Removes duplicate migration paths and returns them in ranked order

func (*Plugin) GetPluginPaths

func (pluginConfig *Plugin) GetPluginPaths() (string, string, error)

func (*Plugin) GetRepoPaths

func (pluginConfig *Plugin) GetRepoPaths() map[string]bool

Removes duplicate repo paths before returning them

type Transformer

type Transformer struct {
	Path           string
	Type           TransformerType
	MigrationPath  string
	MigrationRank  uint64
	RepositoryPath string
}

type TransformerType

type TransformerType int
const (
	UnknownTransformerType TransformerType = iota
	EthEvent
	EthStorage
	EthContract
)

func GetTransformerType

func GetTransformerType(str string) TransformerType

func (TransformerType) String

func (transformerType TransformerType) String() string

Jump to

Keyboard shortcuts

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