messaging

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KafkaType    = "kafka"
	PulsarType   = "pulsar"
	RabbitmqType = "rabbitmq"
)
View Source
const (
	TokenAuthenticationType  = "TOKEN"
	TLSAuthenticationType    = "SSL/TLS"
	ClientAuthenticationType = "SASL/PLAIN"
	NoneAuthenticationType   = "NONE"
)

Security mechanism constants

Variables

This section is empty.

Functions

func New

func New(c config.Config) fx.Option

Types

type AmpqChannel

type AmpqChannel interface {
	Close() error
	Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
}

type Channel

type Channel interface {
	Close() error
	GetType() string
	Accept(event Event) error
}

func GetChannelFrom

func GetChannelFrom(config config.Channel) (Channel, error)

func NewKafkaChannel

func NewKafkaChannel(config config.Channel) (Channel, error)

func NewPulsarChannel

func NewPulsarChannel(config config.Channel) (Channel, error)

func NewRabbitmqChannel

func NewRabbitmqChannel(config config.Channel) (Channel, error)

type Event

type Event struct {
	Id          string           `json:"id,omitempty" yaml:"id,omitempty"`
	Type        string           `json:"type,omitempty" yaml:"type,omitempty"`
	Domain      string           `json:"domain,omitempty" yaml:"domain,omitempty"`
	Src         string           `json:"source,omitempty" yaml:"source,omitempty"`
	Version     string           `json:"version,omitempty" yaml:"version,omitempty"`
	Properties  json.RawMessage  `json:"properties,omitempty" yaml:"properties,omitempty"`
	PublishedAt time.ISODatetime `json:"published_at,omitempty" yaml:"published_at,omitempty"`
	TriggeredBy string           `json:"triggered_by,omitempty" yaml:"triggered_by,omitempty"`
}

type KafkaChannel

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

func (*KafkaChannel) Accept

func (instance *KafkaChannel) Accept(event Event) error

func (*KafkaChannel) Close

func (instance *KafkaChannel) Close() error

func (*KafkaChannel) GetType

func (instance *KafkaChannel) GetType() string

type KafkaProducer

type KafkaProducer interface {
	Close() error
	SendMessage(msg *sarama.ProducerMessage) (partition int32, offset int64, err error)
}

type PulsarChannel

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

func (*PulsarChannel) Accept

func (instance *PulsarChannel) Accept(event Event) error

func (*PulsarChannel) Close

func (instance *PulsarChannel) Close() error

func (*PulsarChannel) GetType

func (instance *PulsarChannel) GetType() string

type PulsarProducer

type PulsarProducer interface {
	Close() error
	SendAndGetMsgID(context.Context, pulsar.ProducerMessage) (pulsar.MessageID, error)
}

type RabbitmqChannel

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

func (*RabbitmqChannel) Accept

func (instance *RabbitmqChannel) Accept(event Event) error

func (*RabbitmqChannel) Close

func (instance *RabbitmqChannel) Close() error

func (*RabbitmqChannel) GetType

func (instance *RabbitmqChannel) GetType() string

Jump to

Keyboard shortcuts

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