goweb

package module
v0.0.0-...-951dc57 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 22 Imported by: 0

README

Goweb

Simple go web server.

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Gin

func Gin(register func(gin.IRouter)) http.Handler

func NotFound

func NotFound(name, id string) error

func OnShutdown

func OnShutdown(hook func())

func RenderError

func RenderError(ctx *gin.Context, op xerr.Op, err error)

func Run

func Run(servers ...Server) error

func WaitShutdown

func WaitShutdown(ctx context.Context)

Types

type GrpcServer

type GrpcServer interface {
	Serve(listener net.Listener) error
	Stop()
}

type RequestInfo

type RequestInfo struct {
	RootId string
	Id     string
}

func GetRequestInfo

func GetRequestInfo(ctx context.Context) (info *RequestInfo)

func (*RequestInfo) String

func (info *RequestInfo) String() string

type Server

type Server interface {
	Name() string
	Run() error
	Stop() error
}

func Grpc

func Grpc(name, addr string, server GrpcServer) Server

func Http

func Http(name, addr string, handler http.Handler) Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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