service

package
v0.0.0-...-2487acb Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderAcceptEncoding  = "Accept-Encoding"
	HeaderContentEncoding = "Content-Encoding"
	HeaderContentLength   = "Content-Length"
	HeaderVary            = "Vary"
)
View Source
const (
	LoggerOpen  = "open"
	LoggerClose = "close"
)

Variables

This section is empty.

Functions

func BasicAuthWarp

func BasicAuthWarp(h httprouter.Handle, userAndPws []string) httprouter.Handle

func BasicAuthWarp2

func BasicAuthWarp2(h http.Handler, userAndPws []string) http.Handler

e.g. router.NotFound(BasicAuthWarp2(http.FileServer(http.Dir(assets)), []string{"admin:admin"}))

func CompatibleWarp

func CompatibleWarp(handle http.HandlerFunc) httprouter.Handle

Types

type QueueAttr

type QueueAttr struct {
	Idcs []string `json:"idcs,omitempty"`
}

type ResponseMessage

type ResponseMessage struct {
	Code    int    `json:"code"`
	Message string `json:"msg,omitempty"`
}

func (*ResponseMessage) Bytes

func (m *ResponseMessage) Bytes() []byte

func (*ResponseMessage) String

func (m *ResponseMessage) String() string

type Router

type Router struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) NotFound

func (r *Router) NotFound(handle http.Handler)

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Server

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

func NewServer

func NewServer(conf *config.Config, version string) (*Server, error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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