config

package
v3.0.0-...-7237cd1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ReqIDKey = "req_id"

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Config

type Config struct {
	Cors                CorsConfig
	TaosConfigDir       string
	Debug               bool
	Port                int
	LogLevel            string
	RestfulRowLimit     int
	HttpCodeServerError bool
	SMLAutoCreateDB     bool
	Log                 Log
	Pool                Pool
	Monitor             Monitor
	UploadKeeper        UploadKeeper
	TMQ                 TMQ
}
var (
	Conf *Config
)

type CorsConfig

type CorsConfig struct {
	AllowAllOrigins  bool
	AllowOrigins     []string
	AllowHeaders     []string
	ExposeHeaders    []string
	AllowCredentials bool
	AllowWebSockets  bool
}

func (*CorsConfig) GetConfig

func (conf *CorsConfig) GetConfig() cors.Config

type Log

type Log struct {
	Path          string
	RotationCount uint
	RotationTime  time.Duration
	RotationSize  uint

	EnableRecordHttpSql bool
	SqlRotationCount    uint
	SqlRotationTime     time.Duration
	SqlRotationSize     uint
}

type Monitor

type Monitor struct {
	Disable                   bool
	CollectDuration           time.Duration
	DisableClientIP           bool
	InCGroup                  bool
	PauseQueryMemoryThreshold float64
	PauseAllMemoryThreshold   float64
	Identity                  string
	WriteToTD                 bool
	User                      string
	Password                  string
	WriteInterval             time.Duration
}

type Pool

type Pool struct {
	MaxConnect  int
	MaxIdle     int
	IdleTimeout time.Duration
}

type TMQ

type TMQ struct {
	ReleaseIntervalMultiplierForAutocommit int
}

type UploadKeeper

type UploadKeeper struct {
	Enable        bool
	Url           string
	Interval      time.Duration
	Timeout       time.Duration
	RetryTimes    uint
	RetryInterval time.Duration
}

Jump to

Keyboard shortcuts

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