config

package module
v0.0.0-...-e5acbb5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderFx = fx.Options(
	fx.Provide(
		GetConfig,
	),
)

ProviderFx ConfigProviderFx : Provider of GetConfig

Functions

func GetConfigDirectory

func GetConfigDirectory() string

func GetConfigName

func GetConfigName() string

GetConfigName get the path from local or docker

func LoadConfig

func LoadConfig(filename, path string) (*viper.Viper, error)

LoadConfig config file from given path

func RootDir

func RootDir() string

Types

type AuthConfig

type AuthConfig struct {
	Auth0ClientID     string `mapstructure:"AUTH0_CLIENT_ID"`
	Auth0Domain       string `mapstructure:"AUTH0_DOMAIN"`
	Auth0ClientSecret string `mapstructure:"AUTH0_CLIENT_SECRET"`
	Auth0CallBackURL  string `mapstructure:"AUTH0_CALL_BACK_URL"`
}

AuthConfig Authentication config: details provided by Auth0

type CadenceConfig

type CadenceConfig struct {
	Domain  string `mapstructure:"DOMAIN"`
	Service string `mapstructure:"SERVICE"`
	Port    string `mapstructure:"PORT"`
	Host    string `mapstructure:"HOST"`
}

type Config

type Config struct {
	Grpc               GrpcServerConfig        `mapstructure:"GRPC"`
	Graphql            GraphqlServerConfig     `mapstructure:"GRAPHQL"`
	Rest               RestServerConfig        `mapstructure:"REST"`
	HealthCheck        HealthCheckServerConfig `mapstructure:"HEALTH_CHECK"`
	Logger             LoggerConfig            `mapstructure:"LOGGER"`
	Postgres           PostgresConfig          `mapstructure:"POSTGRES"`
	Metrics            MetricsConfig           `mapstructure:"METRICS"`
	Jaeger             JaegerServerConfig      `mapstructure:"JAEGER"`
	Auth               AuthConfig              `mapstructure:"AUTH"`
	GithubVCSConfig    VCSSConfig              `mapstructure:"GITHUB_VCS_CONFIG"`
	CadenceConfig      CadenceConfig           `mapstructure:"CADENCE_CONFIG"`
	SupportedVcsConfig []string
}

Config : including all the configuration

func GetConfig

func GetConfig() *Config

GetConfig : will get the config

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

ParseConfig file from the given viper

type FileInformation

type FileInformation struct {
	Path string
	Name string
}

type GraphqlServerConfig

type GraphqlServerConfig struct {
	Port           string `mapstructure:"PORT"`
	Host           string `mapstructure:"HOST"`
	RequestTimeout int    `mapstructure:"REQUEST_TIMEOUT"`
}

GraphqlServerConfig GraphqlServerConfig: Graphql server configuration

type GrpcServerConfig

type GrpcServerConfig struct {
	Port           string `mapstructure:"PORT"`
	Host           string `mapstructure:"HOST"`
	RequestTimeout int    `mapstructure:"REQUEST_TIMEOUT"`
}

GrpcServerConfig GrpcServerConfig: gRPC server configuration Timeout is the request timeout: any client request take longer then the given timeout will automatically cancelled.

type HealthCheckServerConfig

type HealthCheckServerConfig struct {
	Port string `mapstructure:"PORT"`
	Host string `mapstructure:"HOST"`
}

HealthCheckServerConfig HealthCheckServerConfig: Configuration about health check

type JaegerServerConfig

type JaegerServerConfig struct {
	Host        string `mapstructure:"HOST"`
	Port        string `mapstructure:"PORT"`
	ServiceName string `mapstructure:"SERVICE_NAME"`
	LogSpans    string `mapstructure:"LOG_SPANS"`
}

JaegerServerConfig : detail config about the Jaeger

type LoggerConfig

type LoggerConfig struct {
	LogLevel string `mapstructure:"LOG_LEVEL"`
}

LoggerConfig LoggerConfig: Zapier log level

type MetricsConfig

type MetricsConfig struct {
	URL         string `mapstructure:"URL"`
	ServiceName string `mapstructure:"SERVICE_NAME"`
}

MetricsConfig : detail config about the Metrics

type PostgresConfig

type PostgresConfig struct {
	Host     string `mapstructure:"HOST"`
	Port     string `mapstructure:"PORT"`
	User     string `mapstructure:"USER"`
	Password string `mapstructure:"PASSWORD"`
	DbName   string `mapstructure:"DB_NAME"`
	SslMode  string `mapstructure:"SSL_MODE"`
	Driver   string `mapstructure:"PG_DRIVER"`
}

PostgresConfig PostgresConfig: detail config about the postgres database

type RestServerConfig

type RestServerConfig struct {
	Port           string `mapstructure:"PORT"`
	Host           string `mapstructure:"HOST"`
	RequestTimeout int    `mapstructure:"REQUEST_TIMEOUT"`
}

RestServerConfig RestServerConfig: Rest Implementation config

type VCSSConfig

type VCSSConfig struct {
	IType        int    `mapstructure:"ITYPE"`
	Provider     string `mapstructure:"PROVIDER"`
	URLTemplate  string `mapstructure:"URL_TEMPLATE"`
	ClientID     string `mapstructure:"CLIENT_ID"`
	RedirectURI  string `mapstructure:"REDIRECT_URI"`
	State        string `mapstructure:"STATE"`
	Scope        string `mapstructure:"SCOPE"`
	ResponseType string `mapstructure:"RESPONSE_TYPE"`
	ClientSecret string `mapstructure:"CLIENT_SECRET"`
	Name         string `mapstructure:"NAME"`
}

VCSSConfig like github,gitlab,bitbucket config

func GetVcsConfig

func GetVcsConfig(name string, vcsConfig []VCSSConfig) *VCSSConfig

GetVcsConfig : will give the particular vcs config

Jump to

Keyboard shortcuts

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