config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: MIT Imports: 2 Imported by: 405

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(cfg Config)

Set sets the config.

Types

type Config

type Config struct {
	// An array supports multi database connection. The first
	// element of DATABASE is the default connection. See the
	// file connection.go.
	DATABASE []Database

	// The cookie domain used in the auth modules. see
	// the session.go.
	DOMAIN string

	// Used to set as the localize language which show in the
	// interface.
	LANGUAGE string

	// The global url prefix.
	PREFIX string

	// The theme name of template.
	THEME string

	// The path where files will be stored into.
	STORE Store

	// The title of web page.
	TITLE string

	LOGO template.HTML

	MINILOGO template.HTML

	// The url redirect to after login
	INDEX string
}

Config type is the global config of goAdmin. It will be initialized in the engine.

func Get

func Get() Config

Get gets the config.

type Database

type Database struct {
	HOST         string
	PORT         string
	USER         string
	PWD          string
	NAME         string
	MAX_IDLE_CON int
	MAX_OPEN_CON int
	DRIVER       string

	FILE string
}

Database is a type of database connection config. Because a little difference of different database driver. The Config has multiple options but may be not used. Such as the sqlite driver only use the FILE option which can be ignored when the driver is mysql.

type Store

type Store struct {
	PATH   string
	PREFIX string
}

Store is the file store config. Path is the local store path. and prefix is the url prefix used to visit it.

Jump to

Keyboard shortcuts

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