server

package
v0.0.0-...-ce5e3e6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvOrElse

func GetEnvOrElse(key, fallback string) string

GetEnvOrElse retrieves the value of environment variable or fallback if it does not exist

func Start

func Start()

Start starts the HTTP server

Types

type Config

type Config struct {
	Server   *ListenerConfig
	Metadata map[string]string
}

Config store the main application configuration

func ReadConfig

func ReadConfig(env string) *Config

ReadConfig loads the environment-specific configuration in config directory

type HTTPSServerConfig

type HTTPSServerConfig struct {
	Port     int
	KeyFile  string
	CertFile string
}

HTTPSServerConfig stores HTTPS server specific config

type HTTPServerConfig

type HTTPServerConfig struct {
	Port int
}

HTTPServerConfig stores HTTP server specific config

type ListenerConfig

type ListenerConfig struct {
	HTTP  *HTTPServerConfig
	HTTPS *HTTPSServerConfig
}

ListenerConfig stores HTTP or HTTPS server config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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