http_server_config

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PkgName = "http_server"

Variables

This section is empty.

Functions

func DefaultMetricPathRewriter added in v1.1.9

func DefaultMetricPathRewriter(origin string) string

Types

type Config

type Config struct {
	Name string
	Host string // IP地址,默认0.0.0.0
	Port int    // Port端口,默认80

	Timeout          time.Duration
	SlowLogThreshold time.Duration // 慢日志记录的阈值,默认 1s

	EnableTraceInterceptor  bool
	EnableMetricInterceptor bool
	EnableLogInterceptor    bool
	EnableAccessInterceptor bool // 是否开启记录请求数据,默认开启

	EnableFielLogger   bool // 将日志输出到文件
	FielLoggerPath     string
	MetricPathRewriter MetricPathRewriter
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig default config ...

func GetViperConfig

func GetViperConfig(key string, cfg *viper.Viper) (*Config, error)

func (Config) InitLogger

func (config Config) InitLogger()

type MetricPathRewriter added in v1.1.9

type MetricPathRewriter func(origin string) string

Jump to

Keyboard shortcuts

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