types

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PostgresServiceName = "postgres"
	SqliteServiceName   = "sqlite"
)
View Source
const AppConfigServiceName = "appconfig"
View Source
const LoggerServiceName = "logger"

Variables

This section is empty.

Functions

This section is empty.

Types

type ADIFBand

type ADIFBand string

type ADIFDate

type ADIFDate struct {
	time.Time
}

type ADIFFreq

type ADIFFreq float64

type ADIFTime

type ADIFTime struct {
	time.Time
}

type AppConfig

type AppConfig struct {
	DatastoreConfigs []DatastoreConfig
	LoggingConfig    LoggingConfig
}

type DatastoreConfig

type DatastoreConfig struct {
	Driver          string `json:"driver" validate:"required,oneof=postgres sqlite"`
	Path            string `json:"path" validate:"required_if=Driver sqlite"` // Used for sqlite3 only
	Options         string `json:"options"`                                   // Used for sqlite3 only
	Host            string `json:"host" validate:"required,hostname|ip"`
	Port            int    `json:"port" validate:"required,min=1,max=65535"`
	User            string `json:"user" validate:"required,min=1,max=63,alphanum|contains=_|contains=-"`
	Password        string `json:"pass" validate:"required,min=1"`
	Database        string `json:"database" validate:"required,min=1,max=63,alphanum|contains=_|contains=-"`
	SSLMode         string `json:"ssl_mode" validate:"required,oneof=disable require verify-ca verify-full"`
	MaxOpenConns    int    `json:"max_open_conns" validate:"required,min=1"`
	MaxIdleConns    int    `json:"max_idle_conns" validate:"required,min=1"`
	ConnMaxLifetime int    `json:"conn_max_lifetime" validate:"required,min=0"`  // Number of minutes: 1-15 minutes
	ConnMaxIdleTime int    `json:"conn_max_idle_time" validate:"required,min=0"` // Number of minutes: 1-5 minutes

	ContextTimeout            int `json:"context_timeout" validate:"required,min=5"`             // Number of seconds, with a minimum of 5 seconds
	TransactionContextTimeout int `json:"transaction_context_timeout" validate:"required,min=5"` // Number of seconds, with a minimum of 5 seconds

	Debug bool // Enable SQLBoiler query logging

	Params map[string]string `json:"params"`
}

type LoggingConfig added in v0.0.2

type LoggingConfig struct {
	Level                  string `json:"level" validate:"oneof=trace debug info warn error fatal panic"`
	SkipFrameCount         int    `json:"skip_frame_count" validate:"min=0"`
	WithTimestamp          bool   `json:"with_timestamp"`
	ConsoleLogging         bool   `json:"console_logging"`
	FileLogging            bool   `json:"file_logging"`
	RelLogFileDir          string `json:"rel_log_file_dir" validate:"required"`
	LogFileMaxBackups      int    `json:"log_file_max_backups" validate:"min=0"`
	LogFileMaxAgeDays      int    `json:"log_file_max_age_days" validate:"min=0"`
	LogFileMaxSizeMB       int    `json:"log_file_max_size_mb" validate:"min=1"`
	ShutdownTimeoutMS      int    `json:"shutdown_timeout_ms" validate:"omitempty,min=10,max=10000"` // Timeout for graceful shutdown (10ms-10s, 0=use default)
	ShutdownTimeoutWarning bool   `json:"shutdown_timeout_warning"`                                  // Log warning if the shutdown timeout is exceeded

	// Optional polish fields
	ConsoleNoColor    bool   `json:"console_no_color"`
	ConsoleTimeFormat string `json:"console_time_format"`
	LogFileCompress   bool   `json:"log_file_compress"`
}

Jump to

Keyboard shortcuts

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