conf

package
v0.0.0-...-5c0bb04 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package conf generated by go-bindata.// sources: app.ini

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildTime   string
	BuildCommit string
)

Build time and commit information.

⚠️ WARNING: should only be set by "-ldflags".

View Source
var (
	UseSQLite3    bool
	UseMySQL      bool
	UsePostgreSQL bool
	UseMSSQL      bool
)

Indicates which database backend is currently being used.

View Source
var (
	// App for project basic
	App = struct {
		Version  string `ini:"-"`
		Name     string
		Debug    bool
		IPDBPath string `ini:"IPDB_PATH"`
	}{
		Version:  "no version",
		Name:     "MDClubGo",
		Debug:    true,
		IPDBPath: "conf/mdclubgo.ipdb",
	}
)
View Source
var CustomConf string

CustomConf returns the absolute path of custom configuration file that is used.

View Source
var Installed bool

Installed whether the app is installed

View Source
var Source *ini.File

Source is the configuration object.

View Source
var TestConf = os.Getenv("TEST_CONF")

TestConf app config path read in ENV

Functions

func AppPath

func AppPath() string

AppPath returns the absolute path of the application's binary

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("nonexistent") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CustomDir

func CustomDir() string

CustomDir returns a custom directory

func Init

func Init(customConf string) error

Init initializes configuration from custom/conf/app.ini

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func WorkDir

func WorkDir() string

WorkDir returns a work directory

Types

type CacheOpts

type CacheOpts struct {
	Type      string
	Host      string
	Namespace string
	Username  string
	Password  string
}

CacheOpts cache options

var Cache CacheOpts

Cache settings

type DatabaseOpts

type DatabaseOpts struct {
	Type         string
	Host         string
	Name         string
	User         string
	Password     string
	SSLMode      string `ini:"SSL_MODE"`
	Path         string
	MaxOpenConns int
	MaxIdleConns int
}

DatabaseOpts db options

var Database DatabaseOpts

Database settings

type EmailOpts

type EmailOpts struct {
	Type     string
	Host     string
	From     string
	Username string
	Password string
}

EmailOpts email options

var Email EmailOpts

Email settings

type LogOpts

type LogOpts struct {
	RootPath string `ini:"ROOT_PATH"`
}

LogOpts log options

var Log LogOpts

Log settings

type ServerOpts

type ServerOpts struct {
	HTTPSEnable              bool   `ini:"HTTPS_ENABLE"`
	HTTPAddr                 string `ini:"HTTP_ADDR"`
	HTTPPort                 string `ini:"HTTP_PORT"`
	CertFile                 string
	KeyFile                  string
	AccessControlAllowOrigin string `ini:"ACCESS_CONTROL_ALLOW_ORIGIN"`
	SiteStaticURL            string `ini:"SITE_STATIC_URL"`
}

ServerOpts Server options

var Server ServerOpts

Server settings

type StorageLocalOpts

type StorageLocalOpts struct {
	URL string
}

StorageLocalOpts storage local options

var StorageLocal StorageLocalOpts

StorageLocal settings

type StorageOpts

type StorageOpts struct {
	Type string
}

StorageOpts storage options

var Storage StorageOpts

Storage settings

Jump to

Keyboard shortcuts

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