grpc

package
v0.0.0-...-7febb3a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventsStreamMessage

func EventsStreamMessage(ctx context.Context, appConfig *config.Config, msgCh chan *pb.Event, msgDlvCh chan *pb.Result) error

func GetClientConn

func GetClientConn(ctx context.Context, co *ClientOptions) (conn *grpc.ClientConn, err error)

func SendEvents

func SendEvents(ctx context.Context, appConfig *config.Config, msg *pb.Event) (*pb.Result, error)

func SendRequest

func SendRequest(ctx context.Context, appConfig *config.Config, req *pb.Request) (*pb.Response, error)

func SendResponse

func SendResponse(ctx context.Context, appConfig *config.Config, res *pb.Response) error

func SubscribeToEvents

func SubscribeToEvents(ctx context.Context, appConfig *config.Config, subReq *pb.Subscribe, msgCh chan *pb.EventReceive, errCh chan error) error

func SubscribeToRequests

func SubscribeToRequests(ctx context.Context, appConfig *config.Config, subReq *pb.Subscribe, reqCh chan *pb.Request, errCh chan error) error

Types

type ClientOptions

type ClientOptions struct {
	Address string
	// contains filtered or unexported fields
}

func NewClientOptions

func NewClientOptions(addr string) *ClientOptions

func (*ClientOptions) SetSecureConnection

func (co *ClientOptions) SetSecureConnection(certFile, certDomain string) *ClientOptions

TODO - Add test for secure gRPC

type Server

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

func NewServer

func NewServer(svc *services.SystemServices, appConfig *config.Config) (s *Server, err error)

func (*Server) AckAllQueueMessages

func (s *Server) AckAllQueueMessages(ctx context.Context, request *pb.AckAllQueueMessagesRequest) (*pb.AckAllQueueMessagesResponse, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Ping

func (s *Server) Ping(ctx context.Context, req *pb.Empty) (*pb.PingResult, error)

func (*Server) QueuesDownstream

func (s *Server) QueuesDownstream(stream pb.Kubemq_QueuesDownstreamServer) error

func (*Server) QueuesInfo

func (s *Server) QueuesInfo(ctx context.Context, request *pb.QueuesInfoRequest) (*pb.QueuesInfoResponse, error)
func (s *Server) watch() {
	for {
		select {
		case <-time.After(5 * time.Second):
			fmt.Printf("Counter1: %d, Counter2: %d\n", client.Counter1.Load(), client.Counter2.Load())
		}
	}
}

func (*Server) QueuesUpstream

func (s *Server) QueuesUpstream(stream pb.Kubemq_QueuesUpstreamServer) error

func (*Server) ReceiveQueueMessages

func (s *Server) ReceiveQueueMessages(ctx context.Context, request *pb.ReceiveQueueMessagesRequest) (*pb.ReceiveQueueMessagesResponse, error)

func (*Server) SendEvent

func (s *Server) SendEvent(ctx context.Context, event *pb.Event) (*pb.Result, error)

func (*Server) SendEventsStream

func (s *Server) SendEventsStream(stream pb.Kubemq_SendEventsStreamServer) error

func (*Server) SendQueueMessage

func (s *Server) SendQueueMessage(ctx context.Context, msg *pb.QueueMessage) (*pb.SendQueueMessageResult, error)

func (*Server) SendQueueMessagesBatch

func (s *Server) SendQueueMessagesBatch(ctx context.Context, batchRequest *pb.QueueMessagesBatchRequest) (*pb.QueueMessagesBatchResponse, error)

func (*Server) SendRequest

func (s *Server) SendRequest(ctx context.Context, request *pb.Request) (*pb.Response, error)

func (*Server) SendResponse

func (s *Server) SendResponse(ctx context.Context, response *pb.Response) (*pb.Empty, error)

func (*Server) StreamQueueMessage

func (s *Server) StreamQueueMessage(stream pb.Kubemq_StreamQueueMessageServer) error

func (*Server) SubscribeToEvents

func (s *Server) SubscribeToEvents(subRequest *pb.Subscribe, stream pb.Kubemq_SubscribeToEventsServer) error

func (*Server) SubscribeToRequests

func (s *Server) SubscribeToRequests(subRequest *pb.Subscribe, stream pb.Kubemq_SubscribeToRequestsServer) error

func (*Server) UpdateBrokerStatus

func (s *Server) UpdateBrokerStatus(state bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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