config

package
v0.0.0-...-8c125ef Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvironmentDevelopment = "development"
	EnvironmentProduction  = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Billing

type Billing struct {
	RuPerToken        int64 `yaml:"ru_per_token" default:"1000"`
	SlackNotification struct {
		BotToken       string `yaml:"bot_token"`
		Channel        string `yaml:"channel"`
		BlockchainScan string `yaml:"blockchain_scan" validate:"required"`
	} `yaml:"slack_notification"`
}

type Database

type Database struct {
	Driver database.Driver `mapstructure:"driver" validate:"required" default:"postgresql"`
	URI    string          `mapstructure:"uri" validate:"required" default:"postgres://postgres:password@localhost:5432/postgres"`
}

type File

type File struct {
	Environment string     `yaml:"environment" validate:"required" default:"development"`
	Database    *Database  `yaml:"database"`
	Redis       *Redis     `yaml:"redis"`
	RSS3Chain   *RSS3Chain `yaml:"rss3_chain"`
	Settler     *Settler   `yaml:"settler"`
	Gateway     *Gateway   `yaml:"gateway"`
	Billing     *Billing   `yaml:"billing"`
}

func Setup

func Setup(configFilePath string) (*File, error)

type Gateway

type Gateway struct {
	API struct {
		Listen struct {
			Host     string `yaml:"host" default:"0.0.0.0"`
			Port     uint64 `yaml:"port" default:"5555"`
			PromPort uint64 `yaml:"prom_port" default:"9000"`
		} `yaml:"listen"`
		JWTKey     string `yaml:"jwt_key" validate:"required"`
		SIWEDomain string `yaml:"siwe_domain" validate:"required"`
	} `yaml:"api" validate:"required"`
	Kafka struct {
		Brokers []string `yaml:"brokers" validate:"required"`
		Topic   string   `yaml:"topic" validate:"required"`
	} `yaml:"kafka" validate:"required"`
	Etcd struct {
		Endpoints []string `yaml:"endpoints" validate:"required"`
		Username  *string  `yaml:"username"`
		Password  *string  `yaml:"password"`
	} `yaml:"etcd" validate:"required"`
}

type RSS3Chain

type RSS3Chain struct {
	EndpointL2 string `yaml:"endpoint_l2" validate:"required"`
}

type Redis

type Redis struct {
	URI string `mapstructure:"uri" validate:"required" default:"redis://localhost:6379/0"`
}

type Settler

type Settler struct {
	PrivateKey     string `yaml:"private_key"`
	WalletAddress  string `yaml:"wallet_address"`
	SignerEndpoint string `yaml:"signer_endpoint"`
	// EpochIntervalInHours
	EpochIntervalInHours int    `yaml:"epoch_interval_in_hours" default:"18"`
	GasLimit             uint64 `yaml:"gas_limit" default:"2500000"`
	// BatchSize is the number of Nodes to process in each batch.
	// This is to prevent the contract call from running out of gas.
	BatchSize int `yaml:"batch_size" default:"200"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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