config

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFlags

func GetFlags() *pflag.FlagSet

Get a flag set with all flags mapping to a config value.

Types

type AbiCache added in v1.1.5

type AbiCache struct {
	ApiTimeout time.Duration `yaml:"api_timeout" mapstructure:"api_timeout"`
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddFlag

func (b *Builder) AddFlag(flag *pflag.Flag) *Builder

Add a flag to the builder.

func (*Builder) Build

func (b *Builder) Build() (*Config, error)

Build the config object from file, cli-flags

func (*Builder) SetConfigFile

func (b *Builder) SetConfigFile(filename string) *Builder

Set the config file to read

func (*Builder) SetFlags

func (b *Builder) SetFlags(flags *pflag.FlagSet) *Builder

Set all flags that the builder should use.

func (*Builder) SetSource

func (b *Builder) SetSource(in io.Reader) *Builder

Set the source to read

type Cache added in v1.1.5

type Cache struct {
	Storage string      `yaml:"storage" mapstructure:"storage"`
	Options typed.Typed `yaml:"options" mapstructure:"options"`
}

type Config

type Config struct {
	Name string     `yaml:"name" mapstructure:"name"`
	Ship ShipConfig `yaml:"ship" mapstructure:"ship"`
	Api  string     `yaml:"api" mapstructure:"api"`

	Log log.Config `yaml:"log" mapstructure:"log"`

	Cache Cache `yaml:"cache" mapstructure:"cache"`

	Redis        RedisConfig `yaml:"redis" mapstructure:"redis"`
	MessageCodec string      `yaml:"message_codec" mapstructure:"message_codec"`

	AbiCache AbiCache `yaml:"abi_cache" mapstructure:"abi_cache"`

	Telegram TelegramConfig `yaml:"telegram" mapstructure:"telegram"`
}

type RedisConfig

type RedisConfig struct {
	Addr     string `yaml:"addr"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
	Prefix   string `yaml:"prefix"`
}

type ShipConfig

type ShipConfig struct {
	Url                  string          `yaml:"url" mapstructure:"url"`
	IrreversibleOnly     bool            `yaml:"irreversible_only" mapstructure:"irreversible_only"`
	MaxMessagesInFlight  uint32          `yaml:"max_messages_in_flight" mapstructure:"max_messages_in_flight"`
	StartBlockNum        uint32          `yaml:"start_block_num" mapstructure:"start_block_num"`
	EndBlockNum          uint32          `yaml:"end_block_num" mapstructure:"end_block_num"`
	Chain                string          `yaml:"chain" mapstructure:"chain"`
	Blacklist            types.Blacklist `yaml:"blacklist" mapstructure:"blacklist"`
	BlacklistIsWhitelist bool            `yaml:"blacklist_is_whitelist" mapstructure:"blacklist_is_whitelist"`
	EnableTableDeltas    bool            `yaml:"table_deltas" mapstructure:"table_deltas"`
}

type TelegramConfig

type TelegramConfig struct {
	Id      string `yaml:"id" mapstructure:"id"`
	Channel int64  `yaml:"channel" mapstructure:"channel"`
}

Jump to

Keyboard shortcuts

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