config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	PluginName string `json:"PluginName"`
	ServerPort int    `json:"ServerPort,omitempty"`
}

type Config

type Config struct {
	DataStorageFilePath    string                  `json:"DataStorageFilePath"`
	PluginPath             string                  `json:"PluginPath"`
	StoragePluginName      string                  `json:"StoragePluginName"`
	PoolCommissionRate     float64                 `json:"PoolCommissionRate"`
	Version                string                  `json:"Version"`
	Region                 string                  `json:"Region"`
	DataLoaderPluginConfig *DataLoaderPluginConfig `json:"DataLoaderPluginConfig,omitempty"`
	PayoutLoopConfig       *PayoutLoopConfig       `json:"PayoutLoopConfig,omitempty"`
	APIConfig              *APIConfig              `json:"APIConfig,omitempty"`
}

Config holds all the configuration parameters, serving as a unified config.

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig reads a config file and unmarshals it into a unified Config struct.

type DataLoaderPluginConfig

type DataLoaderPluginConfig struct {
	PluginName           string       `json:"PluginName"`
	FetchIntervalSeconds int          `json:"FetchIntervalSeconds"`
	DataSources          []DataSource `json:"Datasources"`
}

DataLoaderPluginConfig holds the plugin-specific settings for data loaders.

type DataSource

type DataSource struct {
	Endpoint string `json:"Endpoint"`
	NodeType string `json:"NodeType"`
}

DataSource defines the settings for each data source.

type PayoutLoopConfig

type PayoutLoopConfig struct {
	PluginName               string `json:"PluginName"`
	RPCUrl                   string `json:"RPCUrl"`
	PrivateKeyStorePath      string `json:"PrivateKeyStorePath"`
	PrivateKeyPassphrasePath string `json:"PrivateKeyPassphrasePath"`
	PayoutFrequencySeconds   int    `json:"PayoutFrequencySeconds"`
	PayoutThreshold          string `json:"PayoutThreshold"`
}

Jump to

Keyboard shortcuts

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