Documentation
¶
Index ¶
- type GlobalEnvs
- type ServiceEnvs
- func (s *ServiceEnvs) CoupledNamespace() string
- func (s *ServiceEnvs) CoupledPort() int32
- func (s *ServiceEnvs) DefinedEnv(name string) (string, bool)
- func (s *ServiceEnvs) DeploymentEnv() definition.ServiceDeploy
- func (s *ServiceEnvs) Get(key string) string
- func (s *ServiceEnvs) GetBool(name string) (bool, error)
- func (s *ServiceEnvs) GetInt(name string) (int, error)
- func (s *ServiceEnvs) GrpcPort() int32
- func (s *ServiceEnvs) HttpPort() int32
- func (s *ServiceEnvs) IsCICD() bool
- func (s *ServiceEnvs) TrackerHeaderName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalEnvs ¶
type GlobalEnvs struct {
DeploymentEnv definition.ServiceDeploy `env:"MIKROS_SERVICE_DEPLOY,default_value=local"`
TrackerHeaderName string `env:"MIKROS_TRACKER_HEADER_NAME,default_value=X-Request-ID"`
// CI/CD settings
IsCICD bool `env:"MIKROS_CICD_TEST,default_value=false"`
// Coupled clients
CoupledNamespace string `env:"MIKROS_COUPLED_NAMESPACE"`
CoupledPort int32 `env:"MIKROS_COUPLED_PORT,default_value=7070"`
// Default connection ports
GrpcPort int32 `env:"MIKROS_GRPC_PORT,default_value=7070"`
HttpPort int32 `env:"MIKROS_HTTP_PORT,default_value=8080"`
}
GlobalEnvs is the main framework structure that holds environment variables. Main variables are declared as structure member and are loaded directly, using struct tags.
type ServiceEnvs ¶
type ServiceEnvs struct {
// contains filtered or unexported fields
}
ServiceEnvs is the object that will allow all internal (and external) mikros features to access the environment variables loaded.
func NewServiceEnvs ¶
func NewServiceEnvs(defs *definition.Definitions) (*ServiceEnvs, error)
NewServiceEnvs loads the framework main environment variables through the env feature plugin.
func (*ServiceEnvs) CoupledNamespace ¶
func (s *ServiceEnvs) CoupledNamespace() string
func (*ServiceEnvs) CoupledPort ¶
func (s *ServiceEnvs) CoupledPort() int32
func (*ServiceEnvs) DefinedEnv ¶
func (s *ServiceEnvs) DefinedEnv(name string) (string, bool)
func (*ServiceEnvs) DeploymentEnv ¶
func (s *ServiceEnvs) DeploymentEnv() definition.ServiceDeploy
func (*ServiceEnvs) Get ¶
func (s *ServiceEnvs) Get(key string) string
func (*ServiceEnvs) GrpcPort ¶
func (s *ServiceEnvs) GrpcPort() int32
func (*ServiceEnvs) HttpPort ¶
func (s *ServiceEnvs) HttpPort() int32
func (*ServiceEnvs) IsCICD ¶
func (s *ServiceEnvs) IsCICD() bool
func (*ServiceEnvs) TrackerHeaderName ¶
func (s *ServiceEnvs) TrackerHeaderName() string
Click to show internal directories.
Click to hide internal directories.