config

package
v0.6.14 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Index

Constants

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

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, configFile string) error

CheckErr is to 검증된 오류 정보 반환

func ReplaceEnvPath

func ReplaceEnvPath(str string) string

ReplaceEnvPath is to $ABC/def ==> /abc/def

Types

type AuthJWTConfig

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

AuthJWTConfig is for 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 is for CB-GRPC 클라이언트 설정 구조

type GrpcConfig

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

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

func (*GrpcConfig) Init

func (gConf *GrpcConfig) Init() error

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

type GrpcServerConfig

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

GrpcServerConfig is for CB-GRPC 서버 설정 구조

type GrpcServiceList

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

GrpcServiceList is for CB-GRPC 서비스 목록

type InterceptorsConfig

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

InterceptorsConfig is for GRPC 인터셉터 설정 구조

type JaegerClientConfig

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

JaegerClientConfig is for Jaeger Client 설정 구조

type OpentracingConfig

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

OpentracingConfig is for Opentracing 설정 구조

type Parser

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

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

func MakeParser

func MakeParser() Parser

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

func (Parser) GrpcParse

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

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

type PrometheusMetricsConfig

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

PrometheusMetricsConfig is for Prometheus Metrics 설정 구조

type TLSConfig

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

TLSConfig is for TLS 설정 구조

type UnsupportedVersionError

type UnsupportedVersionError struct {
	Have int
	Want int
}

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

func (*UnsupportedVersionError) Error

func (u *UnsupportedVersionError) Error() string

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

Jump to

Keyboard shortcuts

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