config

package
v0.0.0-...-3d28840 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config - Configuration for Cloud-Barista's GRPC and provides the required process

Index

Constants

View Source
const (
	// ConfigVersion - 설정 구조에 대한 버전
	ConfigVersion = 1
)

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, configFile string) error

CheckErr - 검증된 오류 정보 반환

func ReplaceEnvPath

func ReplaceEnvPath(str string) string

ReplaceEnvPath - $ABC/def ==> /abc/def

Types

type AuthJWTConfig

type AuthJWTConfig struct {
	JWTKey   string `mapstructure:"jwt_key"`
	JWTToken string `mapstructure:"jwt_token"`
}

AuthJWTConfig - AuthJWT 설정 구조

type GrpcClientConfig

type GrpcClientConfig struct {
	ServerAddr   string              `mapstructure:"server_addr"`
	Timeout      time.Duration       `mapstructure:"timeout"`
	TLS          *TLSConfig          `mapstructure:"tls"`
	Interceptors *InterceptorsConfig `mapstructure:"interceptors"`
}

GrpcClientConfig - CB-GRPC 클라이언트 설정 구조

type GrpcConfig

type GrpcConfig struct {
	Version int             `mapstructure:"version"`
	GSL     GrpcServiceList `mapstructure:"grpc"`
}

GrpcConfig - CB-GRPC 서비스 설정 구조

func (*GrpcConfig) Init

func (gConf *GrpcConfig) Init() error

Init - 설정에 대한 검사 및 초기화

type GrpcServerConfig

type GrpcServerConfig struct {
	Addr         string              `mapstructure:"addr"`
	Reflection   string              `mapstructure:"reflection"`
	TLS          *TLSConfig          `mapstructure:"tls"`
	Interceptors *InterceptorsConfig `mapstructure:"interceptors"`
}

GrpcServerConfig - CB-GRPC 서버 설정 구조

type GrpcServiceList

type GrpcServiceList struct {
	TumblebugSrv *GrpcServerConfig `mapstructure:"tumblebugsrv"`
	TumblebugCli *GrpcClientConfig `mapstructure:"tumblebugcli"`
	SpiderCli    *GrpcClientConfig `mapstructure:"spidercli"`
}

GrpcServiceList - CB-GRPC 서비스 목록

type InterceptorsConfig

type InterceptorsConfig struct {
	AuthJWT           *AuthJWTConfig           `mapstructure:"auth_jwt"`
	PrometheusMetrics *PrometheusMetricsConfig `mapstructure:"prometheus_metrics"`
	Opentracing       *OpentracingConfig       `mapstructure:"opentracing"`
}

InterceptorsConfig - GRPC 인터셉터 설정 구조

type JaegerClientConfig

type JaegerClientConfig struct {
	Endpoint    string  `mapstructure:"endpoint"`
	ServiceName string  `mapstructure:"service_name"`
	SampleRate  float64 `mapstructure:"sample_rate"`
}

JaegerClientConfig - Jaeger Client 설정 구조

type OpentracingConfig

type OpentracingConfig struct {
	Jaeger *JaegerClientConfig `mapstructure:"jaeger"`
}

OpentracingConfig - Opentracing 설정 구조

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser - Viper lib를 활용하기 위한 Parser 정의 구조 형식

func MakeParser

func MakeParser() Parser

MakeParser - Viber lib를 활용하는 설정 Parser 생성

func (Parser) GrpcParse

func (p Parser) GrpcParse(configFile string) (GrpcConfig, error)

GrpcParse - Viper lib를 이용해서 지정된 CB-GRPC configuration 정보 파싱

type PrometheusMetricsConfig

type PrometheusMetricsConfig struct {
	ListenPort int `mapstructure:"listen_port"`
}

PrometheusMetricsConfig - Prometheus Metrics 설정 구조

type TLSConfig

type TLSConfig struct {
	TLSCert string `mapstructure:"tls_cert"`
	TLSKey  string `mapstructure:"tls_key"`
	TLSCA   string `mapstructure:"tls_ca"`
}

TLSConfig - TLS 설정 구조

type UnsupportedVersionError

type UnsupportedVersionError struct {
	Have int
	Want int
}

UnsupportedVersionError - 설정 초기화 과정에서 버전 검증을 통해 반환할 오류 구조

func (*UnsupportedVersionError) Error

func (u *UnsupportedVersionError) Error() string

Error - 비 호환 버전에 대한 오류 문자열 반환

Jump to

Keyboard shortcuts

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