gserver

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 22 Imported by: 2

Documentation

Overview

Package mock is a generated GoMock package.

Index

Constants

View Source
const (
	GinNoblTypeID = "3c9e8119-3d42-45bd-98f9-32939c895c6d"
)
View Source
const (
	ServerNoblTypeID = "77a766e7-c288-413f-946b-bc9de6df3d70"
)
View Source
const (
	WebSocketTypeID = "27709862-0a7b-48e9-8427-5bbc86760c41"
)

Variables

This section is empty.

Functions

func GinNoblTypeLives

func GinNoblTypeLives() []*dot.TypeLives

GinNoblTypeLives Data structure needed when generating newer component

func HttpNoblConfigTypeLive

func HttpNoblConfigTypeLive() *dot.ConfigTypeLive

jayce edit return config of HttpNobl

func HttpNoblTypeLives

func HttpNoblTypeLives() []*dot.TypeLives

HttpNoblTypeLives Data structure needed when generating newer component

func ServerNoblConfigTypeLive

func ServerNoblConfigTypeLive() *dot.ConfigTypeLive

jayce edit return config of ServerNobl

func ServerNoblTypeLives

func ServerNoblTypeLives() []*dot.TypeLives

Data structure needed when generating newer component

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

StreamServerInterceptor returns a new streaming server interceptor for panic recovery.

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor for panic recovery.

func WebSocketTypeLives

func WebSocketTypeLives() []*dot.TypeLives

WebSocketTypeLives

Types

type ConfigNobl

type ConfigNobl struct {
	Name  string          `json:"name"`
	Addrs []string        `json:"addrs"` //sample :  1.1.1.1:568
	Tls   utils.TlsConfig `json:"tls"`
}

type MockServerNobl

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

MockServerNobl is a mock of ServerNobl interface

func NewMockServerNobl

func NewMockServerNobl(ctrl *gomock.Controller) *MockServerNobl

NewMockServerNobl creates a new mock instance

func (*MockServerNobl) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockServerNobl) Server

func (m *MockServerNobl) Server() *grpc.Server

Server mocks base method

type MockServerNoblMockRecorder

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

MockServerNoblMockRecorder is the mock recorder for MockServerNobl

func (*MockServerNoblMockRecorder) Server

func (mr *MockServerNoblMockRecorder) Server() *gomock.Call

Server indicates an expected call of Server

type ServerNobl

type ServerNobl interface {
	Server() *grpc.Server
}

type WebSocket

type WebSocket struct {
	GinEngine *gindot.Engine `dot:""`
	// contains filtered or unexported fields
}

WebSocket component makes it possible the full-duplex communication with low latency between a gRPC-WebSocket request and a remote standard gRPC server.

func (*WebSocket) Stop

func (s *WebSocket) Stop(ignore bool) error

func (*WebSocket) Wrap

func (s *WebSocket) Wrap(grpcServer *grpc.Server)

Wrap wraps the given grpcServer to allow for handling grpc-web requests of websockets - enabling bidirectional requests.

Under the hood, Wrap takes a HTTP request from gin.Context and if it is a gRPC-WebSocket request wraps it with a compatibility layer to transform it to a standard gRPC request for the wrapped gRPC server and transforms the request to comply with the gRPC-Web protocol.

Through this mechanism, client (e.g. browser) is able to fully take advantage of WebSocket communication with remote gRPC service server, initially routed by the HTTP GET method and the URLs of resources that are registered on gRPC server

Note: this Wrap method can only be called before the underlying gin.Engine starts running, besides the caller must insure that all the grpc service servers get appropriately registered with the standard gRPC server.

Jump to

Keyboard shortcuts

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