grpc

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

type HTTPServer struct {
	*httpserver.Server
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(opts ...HTTPServerOpt) *HTTPServer

func (*HTTPServer) RegisterService

func (srv *HTTPServer) RegisterService(sd *ServiceDescription, impl interface{}) error

RegistService

type HTTPServerCfg

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

type HTTPServerOpt

type HTTPServerOpt func(*HTTPServerCfg)

func Host

func Host(host string) HTTPServerOpt

func TLSConfig added in v0.3.0

func TLSConfig(opts ...tlsconfig.Option) HTTPServerOpt

type MethodDescription

type MethodDescription struct {
	MethodName string
	Handler    MethodHandler
	Option     *options.HttpOption
}

type MethodHandler

type MethodHandler func(interface{}, context.Context, http.ResponseWriter, *http.Request)

MethodHandler handler format

type PBContextFunc

type PBContextFunc func(req *http.Request, ctx context.Context) context.Context
var PBContext PBContextFunc

type PBRequestFunc

type PBRequestFunc func(req *http.Request, in proto.Message) error
var PBRequest PBRequestFunc

type PBResponseFunc

type PBResponseFunc func(wr http.ResponseWriter, out proto.Message, err error)
var PBResponse PBResponseFunc

type ServiceDescription

type ServiceDescription struct {
	PackageName  string
	ServiceName  string
	Implemention interface{}
	Methods      []MethodDescription
	Option       *options.ServiceOption
}

type URIFormatFunc

type URIFormatFunc func(version string, pkg string, service string, method string) string
var URIFormat URIFormatFunc

Jump to

Keyboard shortcuts

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