global

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTLSPolicy = TLSOnly
View Source
const DefaultTLSPort uint = 443

Variables

View Source
var Logger *log.Logger

Functions

func LoadConfig

func LoadConfig(versionInfo string)

Types

type Setting

type Setting struct {
	Port     uint       // HTTP port. Default is 8080.
	ShowConf bool       // If show config info in the log.
	Debug    bool       // If turns on debug mode. Default is false.
	TLS      *TLSOption // If is nil, TLS is off.
	server.Config
}

Setting about ran server

var Config *Setting

func (*Setting) String

func (this *Setting) String() string

type TLSOption

type TLSOption struct {
	PublicKey  string    // Path of public key (certificate)
	PrivateKey string    // Path of private key
	Port       uint      // HTTPS port. Default is DefaultTLSPort.
	Policy     TLSPolicy // TLS policy. Default is DefaultTLSPolicy.
}

TLSOption contains options used in TLS encryption

type TLSPolicy

type TLSPolicy string
const (
	TLSRedirect TLSPolicy = "redirect"
	TLSBoth     TLSPolicy = "both"
	TLSOnly     TLSPolicy = "only"
)

Jump to

Keyboard shortcuts

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