config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TempDir           = os.TempDir()
	BackupDir         = filepath.Join(TempDir, "sonic-backup") + string(os.PathSeparator)
	BackupMarkdownDir = filepath.Join(TempDir, "sonic-backup-markdown") + string(os.PathSeparator)
	DataExportDir     = filepath.Join(TempDir, "sonic-data-export") + string(os.PathSeparator)
	ResourcesDir, _   = filepath.Abs("./resources")
)

Functions

func IsDev

func IsDev() bool

Types

type Config

type Config struct {
	Server     Server      `mapstructure:"server"`
	Log        Log         `mapstructure:"logging"`
	PostgreSQL *PostgreSQL `mapstructure:"postgre"`
	MySQL      *MySQL      `mapstructure:"mysql"`
	SQLite3    *SQLite3    `mapstructure:"sqlite3"`
	Sonic      Sonic       `mapstructure:"sonic"`
}

func NewConfig

func NewConfig() *Config

type Levels

type Levels struct {
	App  string `mapstructure:"app"`
	Gorm string `mapstructure:"gorm"`
}

type Log

type Log struct {
	FileName string `mapstructure:"filename"`
	Levels   Levels `mapstructure:"level"`
	MaxSize  int    `mapstructure:"maxsize"`
	MaxAge   int    `mapstructure:"maxage"`
	Compress bool   `mapstructure:"compress"`
}

type MySQL

type MySQL struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	DB       string `mapstructure:"db"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type PostgreSQL

type PostgreSQL struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	DB       string `mapstructure:"db"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type SQLite3

type SQLite3 struct {
	Enable bool `mapstructure:"enable"`
	File   string
}

type Server

type Server struct {
	Host string `mapstructure:"host"`
	Port string `mapstructure:"port"`
}

type Sonic

type Sonic struct {
	Mode              string `mapstructure:"mode"`
	WorkDir           string `mapstructure:"work_dir"`
	UploadDir         string
	LogDir            string `mapstructure:"log_dir"`
	TemplateDir       string `mapstructure:"template_dir"`
	ThemeDir          string
	AdminResourcesDir string
}

Jump to

Keyboard shortcuts

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