service

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct {
	Req            proto.Message
	Res            proto.Message
	HTTPConfig     *pb.HttpConfig
	HTTPMiddleware func(ctx context.Context, header, query map[string]string, req, res proto.Message) error
	Process        func(ctx context.Context, req, res proto.Message) error
}

type Service

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

func NewService

func NewService() *Service

func (*Service) AddProcessor

func (s *Service) AddProcessor(command string, processor *Processor)

func (*Service) GetAddressCommandSet

func (s *Service) GetAddressCommandSet() []*pb.AddressCommandSet

func (*Service) GetProcessor

func (s *Service) GetProcessor(command string) (processor *Processor, exists bool)

func (*Service) Receive

func (s *Service) Receive(wrappedReq *pb.Request, wrappedRes *pb.Response) (err error)

func (*Service) SendRequest

func (s *Service) SendRequest(ctx context.Context, command string, req proto.Message, res proto.Message) error

func (*Service) SendRequestWithAddress

func (s *Service) SendRequestWithAddress(ctx context.Context, address string, command string, req proto.Message, res proto.Message) error

func (*Service) SendWrappedRequest

func (s *Service) SendWrappedRequest(address string, wrappedReq *pb.Request, wrappedRes *pb.Response) (err error)

func (*Service) SetAddressCommands

func (s *Service) SetAddressCommands(address string, commands []string) error

Jump to

Keyboard shortcuts

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