commons

package
v0.0.0-...-e2819db Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ServerName         = "fastweb"
	ServerVersion      = "1.0"
	HeaderRequestIDKey = "X-Request-ID"
	JSONContentType    = "application/json;charset=utf-8"
	HTMLContentType    = "text/html;charset=utf-8"
)

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger *log.Logger)

Types

type Environment

type Environment struct {
	DevMode bool

	ListenerIP string
	Port       string

	PProfEnable bool

	Concurrency        int
	MaxConnsPerIP      int
	MaxRequestsPerConn int

	StaticDir string

	ContainerMode bool
	// contains filtered or unexported fields
}
var (
	Logger *log.Logger

	Env *Environment
)

func LoadEnvironment

func LoadEnvironment() *Environment

type NoCopy

type NoCopy struct{}

Embed this type into a struct, which mustn't be copied, so `go vet` gives a warning if this struct is copied.

See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details. and also: https://stackoverflow.com/questions/52494458/nocopy-minimal-example

func (*NoCopy) Lock

func (*NoCopy) Lock()

func (*NoCopy) Unlock

func (*NoCopy) Unlock()

Jump to

Keyboard shortcuts

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