grpcwebserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

Types

type GrpcWebServer

type GrpcWebServer struct {
	StreamInterceptor grpc.StreamServerInterceptor
	UnaryInterceptor  grpc.UnaryServerInterceptor
	AllowedOrigins    []string
	AllowAllOrigins   bool

	WrappedGrpc *grpcweb.WrappedGrpcServer
	GrpcServer  *grpc.Server
}

func (*GrpcWebServer) Serve

func (server *GrpcWebServer) Serve() error

Serve start GrpcServer,GrpcWebServer with defined options

type HttpsConf

type HttpsConf struct {
	BindAddr string
	HostName string //cert hostname
	CertFile string
	KeyFile  string
}

type RESTfulMux

type RESTfulMux struct {
	Mux    *runtime.ServeMux //实现RESTful风格api处理复用
	Prefix string
}

type WebServer

type WebServer struct {
	GrpcWebServer *GrpcWebServer
	Router        *gin.Engine
	// contains filtered or unexported fields
}

func NewServer

func NewServer(grpcWebServer *GrpcWebServer, allowCross bool) *WebServer

func (*WebServer) Serve

func (s *WebServer) Serve(httpBind string, https *HttpsConf) error

func (*WebServer) SetRESTfulMux

func (s *WebServer) SetRESTfulMux(mux *RESTfulMux)

Jump to

Keyboard shortcuts

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