global

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 10 Imported by: 2

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 {
	IP       []string   // IP addresses binded to ran server.
	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
	// contains filtered or unexported fields
}

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