rest_server

package
v0.0.0-...-6b04d54 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInterface = ":9999"
View Source
var DefaultMaxIncomingConnections = 0
View Source
var ServerReadTimeout = 200
View Source
var ServerWriteTimeout = 200

Functions

func CreatePublicHandler

func CreatePublicHandler(sc *ServerContext) http.Handler

func ListenAndServeHTTP

func ListenAndServeHTTP(addr string, connLimit int, readTimeout int, writeTimeout int, Handler http.Handler) error

func RatedListen

func RatedListen(protocol string, addr string, limit int) (net.Listener, error)

func RunServer

func RunServer(config *ServerConfig)

func WorkerServer

func WorkerServer()

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

type HandlerMethod

type HandlerMethod func(*Handler) error

type HandlerPrivs

type HandlerPrivs int

type ServerConfig

type ServerConfig struct {
	Interface *string
}

func NewServerConfig

func NewServerConfig(addr *string) *ServerConfig

func ParseCommandLine

func ParseCommandLine() (config *ServerConfig)

func (*ServerConfig) Serve

func (config *ServerConfig) Serve(addr string, Handler http.Handler)

type ServerContext

type ServerContext struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewServerContext

func NewServerContext(config *ServerConfig) *ServerContext

Jump to

Keyboard shortcuts

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