communication

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = types.Module{
	{CreateFunc: NewCommunication},
	{CreateFunc: Adapter},
	{CreateFunc: NewParams},
	{CreateFunc: model.NewConfig},
}

Functions

This section is empty.

Types

type AdapterIn

type AdapterIn struct {
	dig.In

	Connections   *conns.Conns
	ServersHelper *grpc.ServersHelper
}

type AdapterOut

type AdapterOut struct {
	dig.Out

	Service types.Runnable `group:"services"`
}

func Adapter

func Adapter(c Communicator) AdapterOut

type Communication

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

func (*Communication) SendMessage

func (c *Communication) SendMessage(typeMessage string, payload []byte) error

func (*Communication) SetHandlers

func (c *Communication) SetHandlers(hs map[string]model.HandlerFunc) error

func (*Communication) Start

func (c *Communication) Start(ctx context.Context) error

func (*Communication) Stop

func (c *Communication) Stop(ctx context.Context) error

type CommunicationMock

type CommunicationMock struct{}

func NewCommunicationMock

func NewCommunicationMock() *CommunicationMock

func (*CommunicationMock) SendMessage

func (*CommunicationMock) SendMessage(_ string, _ []byte) error

func (*CommunicationMock) SetHandlers

func (*CommunicationMock) SetHandlers(_ map[string]model.HandlerFunc) error

func (*CommunicationMock) Start

func (*CommunicationMock) Stop

type Communicator

type Communicator interface {
	SetHandlers(hs map[string]model.HandlerFunc) error
	Transport
}

func NewCommunication

func NewCommunication(
	cfg *model.Config,
	logger *zap.Logger,
	params *Params,
) (Communicator, error)

type Params

type Params struct {
	Connections   *conns.Conns
	ServersHelper *grpc.ServersHelper
}

func NewParams

func NewParams(in AdapterIn) *Params

type Transport

type Transport interface {
	SendMessage(typeMessage string, payload []byte) error
	types.Runnable
}

type TransportType

type TransportType string

Directories

Path Synopsis
transport

Jump to

Keyboard shortcuts

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