env

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

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
	BuildNumber          string
	// Env on application
	Environment       string
	LoadConfigTimeout time.Duration

	UseSharedListener 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
	// UsePostgresListenerWorker env
	UsePostgresListenerWorker bool
	// UseRabbitMQWorker env
	UseRabbitMQWorker bool

	DebugMode bool

	HTTPRootPath                string
	GraphQLDisableIntrospection bool

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

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

	// JaegerTracingHost env
	JaegerTracingHost string
	// JaegerMaxPacketSize env
	JaegerMaxPacketSize int

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

	// MaxGoroutines env for goroutine semaphore
	MaxGoroutines int

	// Database environment
	DbMongoWriteHost, DbMongoReadHost string
	DbSQLWriteDSN, DbSQLReadDSN       string
	DbRedisReadDSN, DbRedisWriteDSN   string

	// CORS Environment
	CORSAllowOrigins, CORSAllowMethods, CORSAllowHeaders []string
	CORSAllowCredential                                  bool

	StartAt 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