config

package
v0.0.0-...-5b087d4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env   string      `json:"env"`
	MySQL MySQLConfig `json:"mysql"`
	Redis RedisConfig `json:"redis"`
	JWT   JWTConfig   `json:"jwt"`
	Port  int         `json:"port"`
}

func New

func New(path string) (Config, error)

New creates a new config by reading a json file that matches the types above

type JWTConfig

type JWTConfig struct {
	Secret         string `json:"secret"`
	PublicKeyPath  string `json:"public_key_path"`
	PrivateKeyPath string `json:"private_key_path"`
}

type MySQLConfig

type MySQLConfig struct {
	Username     string `json:"username"`
	Password     string `json:"password"`
	DatabaseName string `json:"database"`
	Encoding     string `json:"encoding"`
	Host         string `json:"host"`
	Port         string `json:"port"`
}

type RedisConfig

type RedisConfig struct {
	Host string `json:"host"`
	Post int    `json:"port"`
}

Jump to

Keyboard shortcuts

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