conf

package
v0.0.0-...-f0d8a09 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Application settings
	App struct {
		// ⚠️ WARNING: Should only be set by the main package (i.e. "facegit-web.go").
		Version string `ini:"-"`

		Name    string
		RunMode string
	}

	// log
	Log struct {
		Format   string
		RootPath string
	}

	// Cache settings
	Cache struct {
		Adapter  string
		Interval int
		Host     string
	}

	// web settings
	Rpc struct {
		HttpAddr    string `ini:"http_addr"`
		HttpPort    int    `ini:"http_port"`
		Domain      string
		AppDataPath string
	}

	// Repo settings
	Repo struct {
		RootPath string
	}

	// Other settings
	Other struct {
		ShowFooterBranding         bool
		ShowFooterTemplateLoadTime bool
	}
)
View Source
var File *ini.File

File is the configuration object.

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 is a wrapper for getting conf assets.

func AssetDir

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

AssetDir is a wrapper for getting conf assets.

func CustomDir

func CustomDir() string

CustomDir returns the absolute path of the custom directory that contains local overrides. It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work directory returned by WorkDir function.

func HomeDir

func HomeDir() string

HomeDir returns the home directory by reading environment variables. It may return empty string when environment variables are not set.

func Init

func Init(customConf string) error

func IsProdMode

func IsProdMode() bool

IsProdMode returns true if the application is running in production mode.

func IsWindowsRuntime

func IsWindowsRuntime() bool

IsWindowsRuntime returns true if the current runtime in Windows.

func MustAsset

func MustAsset(name string) []byte

MustAsset is a wrapper for getting conf assets.

func WorkDir

func WorkDir() string

WorkDir returns the absolute path of work directory. It reads the value of environment variable IMAIL_WORK_DIR. When not set, it uses the directory where the application's binary is located.

Types

This section is empty.

Jump to

Keyboard shortcuts

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