config

package
v0.0.0-...-879a25f Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config load the config files for different environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(fileName string)

InitConfig is to load the config file and environment variables

Types

type AntConfig

type AntConfig struct {
	Database   string   `yaml:"database"`
	Collection string   `yaml:"collection"`
	KeyField   string   `yaml:"key_field"`
	Fields     []string `yaml:"fields"`

	GlobalRedisURL  string `envconfig:"GLOBAL_REDIS_URL"`
	GlobalRedisPass string `envconfig:"GLOBAL_REDIS_PASS"`
	GlobalRedisPort string `envconfig:"GLOBAL_REDIS_PORT"`

	ClientRedisURL  string `envconfig:"CLIENT_REDIS_URL"`
	ClientRedisPass string `envconfig:"CLIENT_REDIS_PASS"`
	ClientRedisPort string `envconfig:"CLIENT_REDIS_PORT"`

	MongoURI  string `envconfig:"MONGO_URI"`
	MongoUser string `envconfig:"MONGO_USER"`
	MongoPass string `envconfig:"MONGO_PASS"`
}

AntConfig is the structure of the config used by RedisAnt program

var Config *AntConfig

Config is to store the configuration for the service.

Jump to

Keyboard shortcuts

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