rest

package
v0.0.0-...-5d4f8f2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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 StartServer

func StartServer(listenIp, listenPort, configPath string)

todo: ssl

func ValidateMethod

func ValidateMethod(request, expected string) error

Types

type Handler

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

type HandlerMethod

type HandlerMethod func(*Handler) error

type HandlerPrivs

type HandlerPrivs int

type Master

type Master struct {
	Config *config.Config
}

func NewMasterServer

func NewMasterServer(c *config.Config) *Master

func (*Master) ListenAddress

func (m *Master) ListenAddress() string

func (*Master) Serve

func (m *Master) Serve(Handler http.Handler)

type ServerContext

type ServerContext struct {
	DBContext db.DatabaseContext

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewServerContext

func NewServerContext(config *config_pkg.Config) (*ServerContext, error)

Jump to

Keyboard shortcuts

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