config

package
v3.0.0-...-93162ec Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWaitTimeout = 60
View Source
const ModelKey = "model"
View Source
const ReqIDKey = "QID"
View Source
const SessionIDKey = "SID"

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Config

type Config struct {
	InstanceID          uint8
	Cors                CorsConfig
	TaosConfigDir       string
	MaxSyncMethodLimit  int
	MaxAsyncMethodLimit int
	Debug               bool
	Port                int
	LogLevel            string
	RestfulRowLimit     int
	HttpCodeServerError bool
	SMLAutoCreateDB     bool
	Log                 Log
	Pool                Pool
	Monitor             Monitor
	UploadKeeper        UploadKeeper
}
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 {
	Level            string
	Path             string
	RotationCount    uint
	RotationTime     time.Duration
	RotationSize     uint
	KeepDays         uint
	Compress         bool
	ReservedDiskSize uint

	EnableRecordHttpSql bool
	SqlRotationCount    uint
	SqlRotationTime     time.Duration
	SqlRotationSize     uint
}

type Monitor

type Monitor struct {
	Disable                   bool
	CollectDuration           time.Duration
	InCGroup                  bool
	PauseQueryMemoryThreshold float64
	PauseAllMemoryThreshold   float64
	Identity                  string
}

type Pool

type Pool struct {
	MaxConnect  int
	MaxIdle     int
	IdleTimeout time.Duration
	WaitTimeout int
	MaxWait     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