unifiedconfig

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnifiedConfig

type UnifiedConfig struct {
	// DBPath is the address of the database
	DBPath string `yaml:"db_path"`
	// DBType is the flag signifying the type of database (mysql, sqlite, etc).
	DBType string `yaml:"db_type"`
	// SkipMigrations skips the database migrations.
	SkipMigrations bool `yaml:"skip_migrations"`
	// HTTPPort is the http port for the api.
	HTTPPort uint16 `yaml:"http_port"`
	// ScribeURL is the URL of the Scribe graphql server (indexer).
	ScribeURL string `yaml:"scribe_url"`
	// DefaultRefreshRate is the default rate at which data is refreshed in seconds (indexer).
	DefaultRefreshRate int `yaml:"default_refresh_rate"`
	// Chains stores the chain configurations (indexer).
	Chains []indexerconfig.ChainConfig `yaml:"chains"`
}

UnifiedConfig combines both the server and indexer config into a single type.

func DecodeConfig

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

DecodeConfig parses in a config from a file.

func (*UnifiedConfig) IndexerConfig

func (c *UnifiedConfig) IndexerConfig() indexerconfig.Config

IndexerConfig converts the config to a indexer config for the indexer.

func (*UnifiedConfig) IsValid

func (c *UnifiedConfig) IsValid() error

IsValid makes sure the config is valid.

func (*UnifiedConfig) ServerConfig

func (c *UnifiedConfig) ServerConfig() serverConfig.Config

ServerConfig converts the config to a server config for the api.

Jump to

Keyboard shortcuts

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