grpc_gateway

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressFromEnvironment = ""
)

Variables

View Source
var (
	ServerAddress = "127.0.0.1:0"
)

Functions

func CustomHTTPError

func CustomHTTPError(ctx context.Context, _ *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, _ *http.Request, err error)

自定义错误

func Server

func Server(name string, address string, h Handler) micro.Option

Types

type Handler

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

func NewHandler

func NewHandler(prefix string, endpoint string, gwFunc registerHandlerFunc) Handler

func NewHandlerWithServiceName

func NewHandlerWithServiceName(prefix string, serviceName string, gwFunc registerHandlerFunc) Handler

func (*Handler) AfterHandle

func (h *Handler) AfterHandle(path string, method string, f http.HandlerFunc)

添加后置Handle

func (*Handler) BeforeHandle

func (h *Handler) BeforeHandle(path string, method string, f http.HandlerFunc)

添加前置Handle

func (*Handler) Handler

func (h *Handler) Handler() http.Handler

Jump to

Keyboard shortcuts

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