config

package
v0.0.0-...-f20cb1b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapConfig

type BootstrapConfig struct {
	// The HTTP binding port. Euphoria don't plan to support TLS currently.
	Port int
	// This option would allow the log in stdout, it's only used in development.
	// And debug log would be enabled in this situation.
	Stdout bool
	// The config file path.
	ConfigPath string
}

BootstrapConfig combines the minimal required configs for starting the euphoria. We would parse the configuration by the running arguments.

func Bootstrap

func Bootstrap() *BootstrapConfig

Bootstrap would try to acquire the configuration from command line. Which support the basic configuration for euphoria.

type DatabaseConfig

type DatabaseConfig struct {
	Type         string `toml:"type"` // Type should in SupportedDatabaseTypes.
	Host         string `toml:"host"`
	User         string `toml:"user"`
	Password     string `toml:"password"`
	Schema       string `toml:"schema"`
	SSLMode      string `toml:"ssl-mode"`
	Path         string `toml:"path"` // Path is used for sqlite3
	Charset      string `toml:"charset"`
	Timeout      int    `toml:"timeout"`        // in seconds
	MaxIdleConns int    `toml:"max-idle-conns"` // MaxIdleConns is used in xorm.
	MaxOpenConns int    `toml:"max-open-conns"` // MaxOpenConns is used in xorm.
}

DatabaseConfig defines the all the configuration part for different types of database. This configuration was the only thing which is configured in file.

func Database

func Database(configFile string) *DatabaseConfig

Database load the database related configuration from configuration file. We would return nil if the file doesn't exist.

type Version

type Version struct {
	Major        string `json:"major"`
	Minor        string `json:"minor"`
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	BuildDate    string `json:"buildDate"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

Version contains versioning information. how we'll want to distribute that information.

func EuphoriaVersion

func EuphoriaVersion() *Version

Jump to

Keyboard shortcuts

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