configuration

package
v0.0.0-...-fc325db Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dbmap *gorp.DbMap

Dbmap contains database mapping required to use gorp.

View Source
var JwtKey []byte

JwtKey contains the key used for signing and verifying a JWT using HMAC SHA-256.

Functions

func Read

func Read()

Read reads the configuration file and parses it. If any errors are found, a panic will occur.

func ReadKey

func ReadKey()

ReadKey reads the key used for authenticating JWT.

Types

type Configuration

type Configuration struct {
	ServerHost     string // The hostname on which the HTTP server will run, e.g. 'localhost'.
	ServerPort     int    // The port on which the HTTP server will run, e.g. '8080'.
	Key            string // The relative path of the base64-encoded key used for signing JWT. Recommended size of key: 256 bits.
	AllowedOrigins string // The origin on which requests should be allowed from.
	Database       MySQLConfiguration
}

Configuration stores the main configuration for the application.

var Config Configuration

Config contains the current configuration settings.

type MySQLConfiguration

type MySQLConfiguration struct {
	Username     string // The username of the MySQL user.
	Password     string // The password of the MySQL user.
	DatabaseName string // The MySQL database to use.
	Protocol     string // The protocol to use to connect to the MySQL server, either 'tcp' or 'udp'.
	Host         string // The host to use to connect to the MySQL server, e.g. 'localhost'.
	Port         string // The port to use to connect to the MySQL server, e.g. '3306'.
	Charset      string // The charset to use for connection string, e.g. 'utf8mb4,utf8'.
	Engine       string // The database engine of the MySQL server, e.g. 'InnoDB'.
	Encoding     string // The encoding used on the MySQL server, e.g. 'UTF8'.
}

MySQLConfiguration stores the specific MySQL configuration for this application.

Jump to

Keyboard shortcuts

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