std

package
v0.0.0-...-9d18d81 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

Logger is a middleware that prints http logs.

Types

type Server

type Server struct {
	Middleware func(next httprouter.Handle) httprouter.Handle
	// contains filtered or unexported fields
}

Server implements gateway.HTTPServer by using julienschmidt/httprouter.

func New

func New(addr string) *Server

New returns a server.

func NewWithRouter

func NewWithRouter(addr string, router *httprouter.Router) *Server

NewWithRouter returns a server with preconfigured router.

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(base string, handler ServiceHandler)

RegisterHandler configures the handler to handle http rpcx invoke. It wraps ServiceHandler into httprouter.Handle.

func (*Server) Serve

func (s *Server) Serve() error

Jump to

Keyboard shortcuts

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