rabbitmq

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_client_rabbitmq_conf_proto protoreflect.FileDescriptor

Functions

func MustNewSender

func MustNewSender(c *ProducerConf) queue.Sender

Types

type Admin

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

func MustNewAdmin

func MustNewAdmin(c *RabbitConf) *Admin

func (*Admin) Bind

func (q *Admin) Bind(queueName string, routekey string, exchange string, notWait bool, args amqp.Table) error

type ConsumeHandle

type ConsumeHandle func(ctx context.Context, topic string, key, message []byte) error

type ConsumeHandler

type ConsumeHandler interface {
	Consume(ctx context.Context, topic string, key, message []byte) error
}

type ConsumerConf

type ConsumerConf struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Consumer string `protobuf:"bytes,2,opt,name=consumer,proto3" json:"consumer,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerConf) Descriptor deprecated

func (*ConsumerConf) Descriptor() ([]byte, []int)

Deprecated: Use ConsumerConf.ProtoReflect.Descriptor instead.

func (*ConsumerConf) GetConsumer

func (x *ConsumerConf) GetConsumer() string

func (*ConsumerConf) GetName

func (x *ConsumerConf) GetName() string

func (*ConsumerConf) ProtoMessage

func (*ConsumerConf) ProtoMessage()

func (*ConsumerConf) ProtoReflect

func (x *ConsumerConf) ProtoReflect() protoreflect.Message

func (*ConsumerConf) Reset

func (x *ConsumerConf) Reset()

func (*ConsumerConf) String

func (x *ConsumerConf) String() string

func (*ConsumerConf) Validate

func (m *ConsumerConf) Validate() error

Validate checks the field values on ConsumerConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ConsumerConf) ValidateAll added in v0.0.8

func (m *ConsumerConf) ValidateAll() error

ValidateAll checks the field values on ConsumerConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConsumerConfMultiError, or nil if none found.

type ConsumerConfMultiError added in v0.0.8

type ConsumerConfMultiError []error

ConsumerConfMultiError is an error wrapping multiple validation errors returned by ConsumerConf.ValidateAll() if the designated constraints aren't met.

func (ConsumerConfMultiError) AllErrors added in v0.0.8

func (m ConsumerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConsumerConfMultiError) Error added in v0.0.8

func (m ConsumerConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ConsumerConfValidationError

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

ConsumerConfValidationError is the validation error returned by ConsumerConf.Validate if the designated constraints aren't met.

func (ConsumerConfValidationError) Cause

Cause function returns cause value.

func (ConsumerConfValidationError) Error

Error satisfies the builtin error interface

func (ConsumerConfValidationError) ErrorName

func (e ConsumerConfValidationError) ErrorName() string

ErrorName returns error name.

func (ConsumerConfValidationError) Field

Field function returns field value.

func (ConsumerConfValidationError) Key

Key function returns key value.

func (ConsumerConfValidationError) Reason

Reason function returns reason value.

type ExchangeConf

type ExchangeConf struct {
	Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"`
	Key      string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*ExchangeConf) Descriptor deprecated

func (*ExchangeConf) Descriptor() ([]byte, []int)

Deprecated: Use ExchangeConf.ProtoReflect.Descriptor instead.

func (*ExchangeConf) GetExchange

func (x *ExchangeConf) GetExchange() string

func (*ExchangeConf) GetKey

func (x *ExchangeConf) GetKey() string

func (*ExchangeConf) ProtoMessage

func (*ExchangeConf) ProtoMessage()

func (*ExchangeConf) ProtoReflect

func (x *ExchangeConf) ProtoReflect() protoreflect.Message

func (*ExchangeConf) Reset

func (x *ExchangeConf) Reset()

func (*ExchangeConf) String

func (x *ExchangeConf) String() string

func (*ExchangeConf) Validate

func (m *ExchangeConf) Validate() error

Validate checks the field values on ExchangeConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ExchangeConf) ValidateAll added in v0.0.8

func (m *ExchangeConf) ValidateAll() error

ValidateAll checks the field values on ExchangeConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExchangeConfMultiError, or nil if none found.

type ExchangeConfMultiError added in v0.0.8

type ExchangeConfMultiError []error

ExchangeConfMultiError is an error wrapping multiple validation errors returned by ExchangeConf.ValidateAll() if the designated constraints aren't met.

func (ExchangeConfMultiError) AllErrors added in v0.0.8

func (m ExchangeConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExchangeConfMultiError) Error added in v0.0.8

func (m ExchangeConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ExchangeConfValidationError

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

ExchangeConfValidationError is the validation error returned by ExchangeConf.Validate if the designated constraints aren't met.

func (ExchangeConfValidationError) Cause

Cause function returns cause value.

func (ExchangeConfValidationError) Error

Error satisfies the builtin error interface

func (ExchangeConfValidationError) ErrorName

func (e ExchangeConfValidationError) ErrorName() string

ErrorName returns error name.

func (ExchangeConfValidationError) Field

Field function returns field value.

func (ExchangeConfValidationError) Key

Key function returns key value.

func (ExchangeConfValidationError) Reason

Reason function returns reason value.

type ListenerConf

type ListenerConf struct {
	Rabbit *RabbitConf     `protobuf:"bytes,1,opt,name=rabbit,proto3" json:"rabbit,omitempty"`
	Queues []*ConsumerConf `protobuf:"bytes,2,rep,name=queues,proto3" json:"queues,omitempty"`
	// contains filtered or unexported fields
}

func (*ListenerConf) Descriptor deprecated

func (*ListenerConf) Descriptor() ([]byte, []int)

Deprecated: Use ListenerConf.ProtoReflect.Descriptor instead.

func (*ListenerConf) GetQueues

func (x *ListenerConf) GetQueues() []*ConsumerConf

func (*ListenerConf) GetRabbit

func (x *ListenerConf) GetRabbit() *RabbitConf

func (*ListenerConf) ProtoMessage

func (*ListenerConf) ProtoMessage()

func (*ListenerConf) ProtoReflect

func (x *ListenerConf) ProtoReflect() protoreflect.Message

func (*ListenerConf) Reset

func (x *ListenerConf) Reset()

func (*ListenerConf) String

func (x *ListenerConf) String() string

func (*ListenerConf) Validate

func (m *ListenerConf) Validate() error

Validate checks the field values on ListenerConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListenerConf) ValidateAll added in v0.0.8

func (m *ListenerConf) ValidateAll() error

ValidateAll checks the field values on ListenerConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListenerConfMultiError, or nil if none found.

type ListenerConfMultiError added in v0.0.8

type ListenerConfMultiError []error

ListenerConfMultiError is an error wrapping multiple validation errors returned by ListenerConf.ValidateAll() if the designated constraints aren't met.

func (ListenerConfMultiError) AllErrors added in v0.0.8

func (m ListenerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListenerConfMultiError) Error added in v0.0.8

func (m ListenerConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListenerConfValidationError

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

ListenerConfValidationError is the validation error returned by ListenerConf.Validate if the designated constraints aren't met.

func (ListenerConfValidationError) Cause

Cause function returns cause value.

func (ListenerConfValidationError) Error

Error satisfies the builtin error interface

func (ListenerConfValidationError) ErrorName

func (e ListenerConfValidationError) ErrorName() string

ErrorName returns error name.

func (ListenerConfValidationError) Field

Field function returns field value.

func (ListenerConfValidationError) Key

Key function returns key value.

func (ListenerConfValidationError) Reason

Reason function returns reason value.

type ProducerConf

type ProducerConf struct {
	Rabbit      *RabbitConf `protobuf:"bytes,1,opt,name=rabbit,proto3" json:"rabbit,omitempty"`
	ContentType string      `protobuf:"bytes,2,opt,name=contentType,proto3" json:"contentType,omitempty"`
	// contains filtered or unexported fields
}

func (*ProducerConf) Descriptor deprecated

func (*ProducerConf) Descriptor() ([]byte, []int)

Deprecated: Use ProducerConf.ProtoReflect.Descriptor instead.

func (*ProducerConf) GetContentType

func (x *ProducerConf) GetContentType() string

func (*ProducerConf) GetRabbit

func (x *ProducerConf) GetRabbit() *RabbitConf

func (*ProducerConf) ProtoMessage

func (*ProducerConf) ProtoMessage()

func (*ProducerConf) ProtoReflect

func (x *ProducerConf) ProtoReflect() protoreflect.Message

func (*ProducerConf) Reset

func (x *ProducerConf) Reset()

func (*ProducerConf) String

func (x *ProducerConf) String() string

func (*ProducerConf) Validate

func (m *ProducerConf) Validate() error

Validate checks the field values on ProducerConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ProducerConf) ValidateAll added in v0.0.8

func (m *ProducerConf) ValidateAll() error

ValidateAll checks the field values on ProducerConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ProducerConfMultiError, or nil if none found.

type ProducerConfMultiError added in v0.0.8

type ProducerConfMultiError []error

ProducerConfMultiError is an error wrapping multiple validation errors returned by ProducerConf.ValidateAll() if the designated constraints aren't met.

func (ProducerConfMultiError) AllErrors added in v0.0.8

func (m ProducerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ProducerConfMultiError) Error added in v0.0.8

func (m ProducerConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ProducerConfValidationError

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

ProducerConfValidationError is the validation error returned by ProducerConf.Validate if the designated constraints aren't met.

func (ProducerConfValidationError) Cause

Cause function returns cause value.

func (ProducerConfValidationError) Error

Error satisfies the builtin error interface

func (ProducerConfValidationError) ErrorName

func (e ProducerConfValidationError) ErrorName() string

ErrorName returns error name.

func (ProducerConfValidationError) Field

Field function returns field value.

func (ProducerConfValidationError) Key

Key function returns key value.

func (ProducerConfValidationError) Reason

Reason function returns reason value.

type QueueConf

type QueueConf struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*QueueConf) Descriptor deprecated

func (*QueueConf) Descriptor() ([]byte, []int)

Deprecated: Use QueueConf.ProtoReflect.Descriptor instead.

func (*QueueConf) GetName

func (x *QueueConf) GetName() string

func (*QueueConf) ProtoMessage

func (*QueueConf) ProtoMessage()

func (*QueueConf) ProtoReflect

func (x *QueueConf) ProtoReflect() protoreflect.Message

func (*QueueConf) Reset

func (x *QueueConf) Reset()

func (*QueueConf) String

func (x *QueueConf) String() string

func (*QueueConf) Validate

func (m *QueueConf) Validate() error

Validate checks the field values on QueueConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*QueueConf) ValidateAll added in v0.0.8

func (m *QueueConf) ValidateAll() error

ValidateAll checks the field values on QueueConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in QueueConfMultiError, or nil if none found.

type QueueConfMultiError added in v0.0.8

type QueueConfMultiError []error

QueueConfMultiError is an error wrapping multiple validation errors returned by QueueConf.ValidateAll() if the designated constraints aren't met.

func (QueueConfMultiError) AllErrors added in v0.0.8

func (m QueueConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (QueueConfMultiError) Error added in v0.0.8

func (m QueueConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type QueueConfValidationError

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

QueueConfValidationError is the validation error returned by QueueConf.Validate if the designated constraints aren't met.

func (QueueConfValidationError) Cause

func (e QueueConfValidationError) Cause() error

Cause function returns cause value.

func (QueueConfValidationError) Error

func (e QueueConfValidationError) Error() string

Error satisfies the builtin error interface

func (QueueConfValidationError) ErrorName

func (e QueueConfValidationError) ErrorName() string

ErrorName returns error name.

func (QueueConfValidationError) Field

func (e QueueConfValidationError) Field() string

Field function returns field value.

func (QueueConfValidationError) Key

Key function returns key value.

func (QueueConfValidationError) Reason

func (e QueueConfValidationError) Reason() string

Reason function returns reason value.

type RabbitConf

type RabbitConf struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Host     string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
	Port     int32  `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	VHost    string `protobuf:"bytes,5,opt,name=vHost,proto3" json:"vHost,omitempty"`
	Address  string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*RabbitConf) Descriptor deprecated

func (*RabbitConf) Descriptor() ([]byte, []int)

Deprecated: Use RabbitConf.ProtoReflect.Descriptor instead.

func (*RabbitConf) GetAddress

func (x *RabbitConf) GetAddress() string

func (*RabbitConf) GetHost

func (x *RabbitConf) GetHost() string

func (*RabbitConf) GetPassword

func (x *RabbitConf) GetPassword() string

func (*RabbitConf) GetPort

func (x *RabbitConf) GetPort() int32

func (*RabbitConf) GetUsername

func (x *RabbitConf) GetUsername() string

func (*RabbitConf) GetVHost

func (x *RabbitConf) GetVHost() string

func (*RabbitConf) ProtoMessage

func (*RabbitConf) ProtoMessage()

func (*RabbitConf) ProtoReflect

func (x *RabbitConf) ProtoReflect() protoreflect.Message

func (*RabbitConf) Reset

func (x *RabbitConf) Reset()

func (*RabbitConf) String

func (x *RabbitConf) String() string

func (*RabbitConf) Validate

func (m *RabbitConf) Validate() error

Validate checks the field values on RabbitConf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RabbitConf) ValidateAll added in v0.0.8

func (m *RabbitConf) ValidateAll() error

ValidateAll checks the field values on RabbitConf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RabbitConfMultiError, or nil if none found.

type RabbitConfMultiError added in v0.0.8

type RabbitConfMultiError []error

RabbitConfMultiError is an error wrapping multiple validation errors returned by RabbitConf.ValidateAll() if the designated constraints aren't met.

func (RabbitConfMultiError) AllErrors added in v0.0.8

func (m RabbitConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RabbitConfMultiError) Error added in v0.0.8

func (m RabbitConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RabbitConfValidationError

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

RabbitConfValidationError is the validation error returned by RabbitConf.Validate if the designated constraints aren't met.

func (RabbitConfValidationError) Cause

func (e RabbitConfValidationError) Cause() error

Cause function returns cause value.

func (RabbitConfValidationError) Error

Error satisfies the builtin error interface

func (RabbitConfValidationError) ErrorName

func (e RabbitConfValidationError) ErrorName() string

ErrorName returns error name.

func (RabbitConfValidationError) Field

Field function returns field value.

func (RabbitConfValidationError) Key

Key function returns key value.

func (RabbitConfValidationError) Reason

func (e RabbitConfValidationError) Reason() string

Reason function returns reason value.

type RabbitListener

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

func MustNewListener

func MustNewListener(c *ListenerConf, handler ConsumeHandler) *RabbitListener

func NewListener

func NewListener(c *ListenerConf, handler ConsumeHandler) (consumer *RabbitListener, err error)

func (*RabbitListener) Start

func (s *RabbitListener) Start(context.Context) error

func (*RabbitListener) Stop

type RabbitMqSender

type RabbitMqSender struct {
	ContentType string
	// contains filtered or unexported fields
}

func (*RabbitMqSender) Close

func (q *RabbitMqSender) Close() error

func (*RabbitMqSender) Name

func (q *RabbitMqSender) Name() string

func (*RabbitMqSender) Send

func (q *RabbitMqSender) Send(ctx context.Context, header map[string]interface{}, exchange string, routeKey string, msg []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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