amqp

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectorNotReady = errors.New("connector isn't ready")

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN    string
	Config mt.Config
}

Config of connector.

type Connector

type Connector struct {
	MT mt.MassTransport

	daemon.WatcherConfigFunc
	daemon.HealthCheckFunc
	daemon.ShutdownFunc
	// contains filtered or unexported fields
}

func New

func New(prefix string, opts ...Option) *Connector

func (*Connector) AddHandler

func (conn *Connector) AddHandler(name mt.ServiceName, handler mt.HandlerFunc)

func (*Connector) Call

func (conn *Connector) Call(
	name mt.ServiceName,
	req mt.Request,
	rep mt.ReplyFunc,
) error

func (*Connector) Cast

func (conn *Connector) Cast(name mt.ServiceName, req mt.Request) error

func (*Connector) ConnectAndServe

func (conn *Connector) ConnectAndServe() error

func (*Connector) HealthCheck

func (conn *Connector) HealthCheck() bool

func (*Connector) Shutdown

func (conn *Connector) Shutdown() error

type Option

type Option func(*Connector)

func WithHandler

func WithHandler(serviceName string, handler mt.HandlerFunc) Option

func WithLogger

func WithLogger(l logging.Logger) Option

Jump to

Keyboard shortcuts

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