service

package
v0.0.0-...-cd29b86 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseModel

type ResponseModel struct {
	Message string `json:"message"`
}

ResponseModel is returned by our service when an error occurs.

type Server

type Server struct {
	pb.UnimplementedJobDispatcherServiceServer
	pb.UnimplementedPublisherServiceServer
	// contains filtered or unexported fields
}

Server contains all that is needed to respond to incoming requests, like a database. Other services like a mail

func NewServer

func NewServer(messager messaging.Messager, wrapper messaging.Wrapper, exporter metrics.Exporter, mainAPI string) *Server

NewServer initializes the service with the given Database, and sets up appropriate routes.

func (*Server) Listen

func (s *Server) Listen()

func (*Server) Publish

func (s *Server) Publish(ctx context.Context, in *pb.PublishRequest) (*empty.Empty, error)

Publish push message to subscribers by using gRPC.

func (*Server) PublishREST

func (s *Server) PublishREST(ctx *fasthttp.RequestCtx)

PublishREST push message to subscribers.

func (*Server) Queue

func (s *Server) Queue(ctx context.Context, in *pb.QueueRequest) (*empty.Empty, error)

Queue push message to workers by using gRPC.

func (*Server) QueueREST

func (s *Server) QueueREST(ctx *fasthttp.RequestCtx)

QueueREST push message to workers.

Jump to

Keyboard shortcuts

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