httpserver

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 5 Imported by: 1

README

httpserver

httpserver for grpc/pb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextHandler

type ContextHandler func(context.Context, http.ResponseWriter, *http.Request)

type RouteCfg

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

type RouteOpt

type RouteOpt func(cf *RouteCfg)

func Handler

func Handler(h ContextHandler) RouteOpt
func Header(headers ...string) RouteOpt

func Host

func Host(host string) RouteOpt

func Method

func Method(methods ...string) RouteOpt

func Pattern

func Pattern(pattern string) RouteOpt

func Prefix

func Prefix(prefix string) RouteOpt

func Query

func Query(queries ...string) RouteOpt

func Schema

func Schema(schemas ...string) RouteOpt

type Server

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

func NewServer

func NewServer(opts ...ServerOpt) *Server

func (*Server) Route

func (srv *Server) Route(opts ...RouteOpt)

func (*Server) Serve

func (srv *Server) Serve(ctx context.Context) error

type ServerOpt

type ServerOpt func(*Server)

func IdleTimeout

func IdleTimeout(idle time.Duration) ServerOpt

func ListenAddress

func ListenAddress(addr string) ServerOpt

func ReadTimeout

func ReadTimeout(rd time.Duration) ServerOpt

func TLSFiles

func TLSFiles(certFile, keyFile string) ServerOpt

func WriteTimeout

func WriteTimeout(wr time.Duration) ServerOpt

Directories

Path Synopsis
example
grpc/client command
grpc/server command
simple command

Jump to

Keyboard shortcuts

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