config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver        string        `yaml:"driver"`
	Listen        string        `yaml:"listen"`
	Upstream      string        `yaml:"upstream"`
	GRPC          string        `yaml:"grpc"`
	HTTP          string        `yaml:"http"`
	DSNEnv        string        `yaml:"dsn_env"`
	SlowThreshold time.Duration `yaml:"slow_threshold"`
	NPlus1        NPlus1Config  `yaml:"nplus1"`
}

Config holds the sql-tapd configuration.

func Default

func Default() Config

Default returns a Config with default values.

func Load

func Load(path string) (Config, error)

Load reads the config file specified by path. If path is empty, it looks for the default config file in the current directory. If the default file does not exist, it returns the default config without error.

type NPlus1Config

type NPlus1Config struct {
	Threshold int           `yaml:"threshold"`
	Window    time.Duration `yaml:"window"`
	Cooldown  time.Duration `yaml:"cooldown"`
}

NPlus1Config holds N+1 detection settings.

Jump to

Keyboard shortcuts

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