configuration

package
v0.0.0-...-6279077 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ConfigurationData contains all configuration data
	ConfigurationData = &Configuration{}
)
View Source
var (
	ErrFailedToConnectToSQL = "Failed to connect to mysql %v\n"
)
View Source
var (
	MapMessage map[string]MessageModel
)

Functions

func GetConnection

func GetConnection() *xorm.Session

* get connection database with

func GetEngine

func GetEngine() *xorm.Engine

* get engine

func GetSession

func GetSession() *xorm.Session

* create session

func LoadMessage

func LoadMessage()

* load message configuration and binding into [] MessageModel struct

Types

type Configuration

type Configuration struct {
	Database MySQL
	Host     Host
}

func GetConfiguration

func GetConfiguration() *Configuration

GetConfiguration Get the new configuration

type Host

type Host struct {
	Host string
	Port string
}

type MessageModel

type MessageModel struct {
	InternalMessage string
	Httpcode        int
	StatusCode      int
	Message         string
}

func GetMessage

func GetMessage(errMessage string) MessageModel

get message base on map with key and return message struct

type MySQL

type MySQL struct {
	Hostname     string
	Username     string
	Password     string
	MaxOpenConns string
	MaxIdleConns string
	Schema       string
}

MySQL struct

Jump to

Keyboard shortcuts

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