grpcmux

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CodesErrors = map[codes.Code]string{
	codes.OK:                 "ok",
	codes.Canceled:           "canceled",
	codes.Unknown:            "unknown",
	codes.InvalidArgument:    "invalid_argument",
	codes.DeadlineExceeded:   "deadline_exceeded",
	codes.NotFound:           "not_found",
	codes.AlreadyExists:      "already_exists",
	codes.PermissionDenied:   "permission_denied",
	codes.ResourceExhausted:  "resource_exhausted",
	codes.FailedPrecondition: "failed_precondition",
	codes.Aborted:            "aborted",
	codes.OutOfRange:         "out_of_range",
	codes.Unimplemented:      "unimplemented",
	codes.Internal:           "internal",
	codes.Unavailable:        "unavailable",
	codes.DataLoss:           "data_loss",
	codes.Unauthenticated:    "unauthenticated",
}

CodesErrors some erorrs string for grpc codes

Functions

func CodeToError added in v1.2.0

func CodeToError(c codes.Code) string

CodeToError translate grpc codes to error

Types

type MuxedGrpc added in v1.2.1

type MuxedGrpc struct {
}

MuxedGrpc check the context is by mux grpc

type ServeMux

type ServeMux struct {
	*runtime.ServeMux
}

ServeMux the custom serve mux that implement grpc ServeMux to simplify the http restful

func NewServeMux

func NewServeMux(opts ...runtime.ServeMuxOption) *ServeMux

NewServeMux allocates and returns a new ServeMux.

func (*ServeMux) Handle

func (s *ServeMux) Handle(method string, path string, h runtime.HandlerFunc)

Handle associates "h" to the pair of HTTP method and path pattern.

func (*ServeMux) ServeHTTP

func (s *ServeMux) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP add ctx from http request

Directories

Path Synopsis
_exmaple
pb
Package pb is a reverse proxy.
Package pb is a reverse proxy.

Jump to

Keyboard shortcuts

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