config

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	P2pMainNet = "mainnet"
	P2pTestNet = "testnet"
	P2pDevNet  = "devnet"
)

p2p network constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackfillerConfiguration

type BackfillerConfiguration struct {
	LogLevel                string `env:"LOG_LEVEL,default=INFO"`
	MongoURI                string `env:"MONGODB_URI,required"`
	MongoDatabase           string `env:"MONGODB_DATABASE,required"`
	VaaPayloadParserURL     string `env:"VAA_PAYLOAD_PARSER_URL, required"`
	VaaPayloadParserTimeout int64  `env:"VAA_PAYLOAD_PARSER_TIMEOUT, required"`
	StartTime               string `env:"START_TIME"`
	EndTime                 string `env:"END_TIME"`
	PageSize                int64  `env:"PAGE_SIZE,default=100"`
	SortAsc                 bool   `env:"SORT_ASC,default=false"`
}

BackfillerConfiguration represents the application configuration when running as backfiller with default values.

type ServiceConfiguration

type ServiceConfiguration struct {
	Environment             string `env:"ENVIRONMENT,required"`
	LogLevel                string `env:"LOG_LEVEL,default=INFO"`
	Port                    string `env:"PORT,default=8000"`
	ConsumerMode            string `env:"CONSUMER_MODE,default=QUEUE"`
	MongoURI                string `env:"MONGODB_URI,required"`
	MongoDatabase           string `env:"MONGODB_DATABASE,required"`
	AwsEndpoint             string `env:"AWS_ENDPOINT"`
	AwsAccessKeyID          string `env:"AWS_ACCESS_KEY_ID"`
	AwsSecretAccessKey      string `env:"AWS_SECRET_ACCESS_KEY"`
	AwsRegion               string `env:"AWS_REGION"`
	SQSUrl                  string `env:"SQS_URL"`
	VaaPayloadParserURL     string `env:"VAA_PAYLOAD_PARSER_URL, required"`
	VaaPayloadParserTimeout int64  `env:"VAA_PAYLOAD_PARSER_TIMEOUT, required"`
	PprofEnabled            bool   `env:"PPROF_ENABLED,default=false"`
	P2pNetwork              string `env:"P2P_NETWORK,required"`
	AlertEnabled            bool   `env:"ALERT_ENABLED,default=false"`
	AlertApiKey             string `env:"ALERT_API_KEY"`
	MetricsEnabled          bool   `env:"METRICS_ENABLED,default=false"`
}

ServiceConfiguration represents the application configuration when running as service with default values.

func New

New creates a configuration with the values from .env file and environment variables.

func (*ServiceConfiguration) IsQueueConsumer

func (c *ServiceConfiguration) IsQueueConsumer() bool

IsQueueConsumer check if consumer mode is QUEUE.

Jump to

Keyboard shortcuts

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