config

package
v1.6.7-0...-b28dd99 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	JWTSecret string `json:"jwtSecret"`
}

Auth config.

type Config

type Config struct {
	DB        *DB        `json:"db"`
	HTTP      *HTTP      `json:"http"`
	TLS       *TLS       `json:"tls"`
	Logger    *Logger    `json:"logger"`
	Auth      *Auth      `json:"auth"`
	Websocket *WebSocket `json:"websocket"`
	DataDir   string     `json:"datadir"`
}

Config holds configuration data,

type DB

type DB struct {
	Charset  string `json:"charset" valid:"ascii,optional"`
	Driver   string `json:"driver" valid:"in(mysql|sqlserver|postgres|sqlite|clickhouse),required"`
	Host     string `json:"host" valid:"host,optional"`
	Name     string `json:"name" valid:"ascii,required"`
	Password string `json:"password" valid:"ascii,optional"`
	Port     int    `json:"port" valid:"port,optional"`
	User     string `json:"user" valid:"ascii,optional"`
}

DB database config.

type HTTP

type HTTP struct {
	Addr      string `json:"addr" valid:"host,required"`
	TLS       bool   `json:"tls"`
	UploadDir string `json:"uploadDir"`
	Compress  bool   `json:"compress"`
}

HTTP server config.

type Logger

type Logger struct {
	Filename   string `json:"filename"`
	MaxSize    int    `json:"maxsize"`
	MaxBackups int    `json:"maxbackups"`
	MaxAge     int    `json:"maxage"`
	Level      string `json:"level"`
	Stdout     bool   `json:"stdout"`
}

Logger config.

type TLS

type TLS struct {
	Cert string `json:"cert"`
	Key  string `json:"key"`
}

TLS config.

type WebSocket

type WebSocket struct {
	Addr string `json:"addr"`
}

WebSocket server config.

Jump to

Keyboard shortcuts

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