env

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(serviceName string)

Load environment

func SetEnv

func SetEnv(newEnv Env)

SetEnv set env for mocking data env

Types

type Env

type Env struct {
	RootApp, ServiceName string

	NoAuth bool

	// UseREST env
	UseREST bool
	// UseGraphQL env
	UseGraphQL bool
	// UseGRPC env
	UseGRPC bool
	// UseKafkaConsumer env
	UseKafkaConsumer bool
	// UseCronScheduler env
	UseCronScheduler bool
	// UseRedisSubscriber env
	UseRedisSubscriber bool
	// UseTaskQueueWorker env
	UseTaskQueueWorker bool

	// GraphQLSchemaDir env
	GraphQLSchemaDir string
	// JSONSchemaDir env
	JSONSchemaDir string

	// Env on application
	Environment string

	IsProduction, DebugMode bool

	// HTTPPort config
	HTTPPort uint16
	// GRPCPort Config
	GRPCPort uint16
	// TaskQueueDashboardPort Config
	TaskQueueDashboardPort uint16
	// TaskQueueDashboardMaxClientSubscribers Config
	TaskQueueDashboardMaxClientSubscribers int

	// UseConsul for distributed lock if run in multiple instance
	UseConsul bool
	// ConsulAgentHost consul agent host
	ConsulAgentHost string
	// ConsulMaxJobRebalance env, if worker execute total job in env config, rebalance worker to another active intance
	ConsulMaxJobRebalance int

	// BasicAuthUsername config
	BasicAuthUsername string
	// BasicAuthPassword config
	BasicAuthPassword string

	// JaegerTracingHost env
	JaegerTracingHost string

	// Broker environment
	Kafka struct {
		Brokers       []string
		ClientVersion string
		ClientID      string
		ConsumerGroup string
	}

	// MaxGoroutines env for goroutine semaphore
	MaxGoroutines int

	// Database environment
	DbMongoWriteHost, DbMongoReadHost, DbMongoDatabaseName string
	DbSQLWriteDSN, DbSQLReadDSN                            string
	DbRedisReadDSN, DbRedisWriteDSN                        string
	// contains filtered or unexported fields
}

Env model

func BaseEnv

func BaseEnv() Env

BaseEnv get global basic environment

Jump to

Keyboard shortcuts

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