config

package
v0.0.0-...-559b47e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_NAME = "gin-apiserver"

	FLAG_KEY_SERVER_HOST    = "server.host"
	FLAG_KEY_SERVER_PORT    = "server.port"
	FLAG_KEY_SERVER_VERSION = "0.1.0"
	FLAG_KEY_AUTH_USERNAME  = "auth.username"
	FLAG_KEY_AUTH_PASSWORD  = "auth.password"
	FLAG_KEY_GIN_MODE       = "gin.mode"
	FLAG_KEY_LOG_LEVEL      = "log.level"
)

Variables

This section is empty.

Functions

func GetBool

func GetBool(key string) bool

func GetInt

func GetInt(key string) int

func GetString

func GetString(key string) string

Types

type Auth

type Auth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Config

type Config struct {
	Server *Server `yaml:"server"`
	Auth   *Auth   `yaml:"auth"`
	Gin    *Gin    `yaml:"gin"`
	Log    *Log    `yaml:"log"`
}

func GetConfig

func GetConfig() *Config

type Gin

type Gin struct {
	Mode string `yaml:"mode"`
}

type Log

type Log struct {
	Level string `yaml:"level"`
}

type Server

type Server struct {
	Port    int    `yaml:"port"`
	Host    string `yaml:"host"`
	Version string `yaml:"version"`
}

Jump to

Keyboard shortcuts

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