grpcserver

package
v0.0.0-...-9375491 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStreamingPayload

func GetStreamingPayload(call *xbospb.StreamingCall, msg proto.Message) error

func GetUnaryPayload

func GetUnaryPayload(call *xbospb.UnaryCall, msg proto.Message) error

func MakeStreamingResponse

func MakeStreamingResponse(call *xbospb.StreamingCall, msg proto.Message, err error) (*xbospb.StreamingResponse, error)

func MakeStreamingResponseFinish

func MakeStreamingResponseFinish(call *xbospb.StreamingCall, err error) (*xbospb.StreamingResponse, error)

func MakeUnaryResponse

func MakeUnaryResponse(call *xbospb.UnaryCall, msg proto.Message, err error) (*xbospb.UnaryResponse, error)

Types

type Config

type Config struct {
	SiteRouter string
	EntityFile string
	Namespace  string
	BaseURI    string
	ServerName string
}

type StreamCallback

type StreamCallback func(*xbospb.StreamingCall, *StreamContext) error

type StreamContext

type StreamContext struct {
	C chan proto.Message

	grpc.ServerStream
	// contains filtered or unexported fields
}

func NewStreamingContext

func NewStreamingContext(timeout time.Duration) *StreamContext

func (*StreamContext) Context

func (s *StreamContext) Context() context.Context

func (*StreamContext) Finish

func (s *StreamContext) Finish(call *xbospb.StreamingCall, err error)

func (*StreamContext) GetResponseChannel

func (s *StreamContext) GetResponseChannel() chan *xbospb.StreamingResponse

func (*StreamContext) Send

func (s *StreamContext) Send(msg *mortarpb.FetchResponse) error

TODO: the type of this needs to match the GRPC server implementation unless we can find a way to subvert that

func (*StreamContext) Start

func (s *StreamContext) Start(call *xbospb.StreamingCall)

type UnaryCallback

type UnaryCallback func(*xbospb.UnaryCall) (*xbospb.UnaryResponse, error)

type WaveMQServer

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

func NewWaveMQServer

func NewWaveMQServer(cfg *Config) (*WaveMQServer, error)

func (*WaveMQServer) OnStream

func (wmq *WaveMQServer) OnStream(method string, cb StreamCallback)

func (*WaveMQServer) OnUnary

func (wmq *WaveMQServer) OnUnary(method string, cb UnaryCallback)

func (*WaveMQServer) Serve

func (wmq *WaveMQServer) Serve() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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