rabbitmq

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExchangeDirect  = amqp.ExchangeDirect
	ExchangeFanout  = amqp.ExchangeFanout
	ExchangeTopic   = amqp.ExchangeTopic
	ExchangeHeaders = amqp.ExchangeHeaders
)
View Source
var (
	ErrorReason_name = map[int32]string{
		0: "UNKOWN",
		1: "DISCONNECT",
		2: "CHANNEL_CLOSED",
	}
	ErrorReason_value = map[string]int32{
		"UNKOWN":         0,
		"DISCONNECT":     1,
		"CHANNEL_CLOSED": 2,
	}
)

Enum value maps for ErrorReason.

View Source
var File_queue_rabbitmq_conf_proto protoreflect.FileDescriptor

Functions

func Client

func Client(ctx context.Context, msg []byte) []byte

func ErrorChannelClosed

func ErrorChannelClosed(format string, args ...interface{}) *errors.Error

channel 断了

func ErrorDisconnect

func ErrorDisconnect(format string, args ...interface{}) *errors.Error

断链接了

func ErrorUnkown

func ErrorUnkown(format string, args ...interface{}) *errors.Error

func IsChannelClosed

func IsChannelClosed(err error) bool

channel 断了

func IsDisconnect

func IsDisconnect(err error) bool

断链接了

func IsUnkown

func IsUnkown(err error) bool

func MustNewListener

func MustNewListener(c *ListenerConf, handler ConsumeHandler) queue.MessageQueue

func NewListener

func NewListener(c *ListenerConf, handler ConsumeHandler) (consumer queue.MessageQueue, err error)

func Server

func Server(msg []byte) (context.Context, context.CancelFunc, []byte, error)

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, kind string, args amqp.Table) error

type AdminExchangeConf

type AdminExchangeConf struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Kind       string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	Durable    bool   `protobuf:"varint,3,opt,name=durable,proto3" json:"durable,omitempty"`
	AutoDelete bool   `protobuf:"varint,4,opt,name=autoDelete,proto3" json:"autoDelete,omitempty"`
	Internal   bool   `protobuf:"varint,5,opt,name=internal,proto3" json:"internal,omitempty"`
	NoWait     bool   `protobuf:"varint,6,opt,name=noWait,proto3" json:"noWait,omitempty"`
	// contains filtered or unexported fields
}

func (*AdminExchangeConf) Descriptor deprecated

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

Deprecated: Use AdminExchangeConf.ProtoReflect.Descriptor instead.

func (*AdminExchangeConf) GetAutoDelete

func (x *AdminExchangeConf) GetAutoDelete() bool

func (*AdminExchangeConf) GetDurable

func (x *AdminExchangeConf) GetDurable() bool

func (*AdminExchangeConf) GetInternal

func (x *AdminExchangeConf) GetInternal() bool

func (*AdminExchangeConf) GetKind

func (x *AdminExchangeConf) GetKind() string

func (*AdminExchangeConf) GetName

func (x *AdminExchangeConf) GetName() string

func (*AdminExchangeConf) GetNoWait

func (x *AdminExchangeConf) GetNoWait() bool

func (*AdminExchangeConf) ProtoMessage

func (*AdminExchangeConf) ProtoMessage()

func (*AdminExchangeConf) ProtoReflect

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

func (*AdminExchangeConf) Reset

func (x *AdminExchangeConf) Reset()

func (*AdminExchangeConf) String

func (x *AdminExchangeConf) String() string

func (*AdminExchangeConf) Validate

func (m *AdminExchangeConf) Validate() error

Validate checks the field values on AdminExchangeConf 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 (*AdminExchangeConf) ValidateAll

func (m *AdminExchangeConf) ValidateAll() error

ValidateAll checks the field values on AdminExchangeConf 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 AdminExchangeConfMultiError, or nil if none found.

type AdminExchangeConfMultiError

type AdminExchangeConfMultiError []error

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

func (AdminExchangeConfMultiError) AllErrors

func (m AdminExchangeConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AdminExchangeConfMultiError) Error

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

type AdminExchangeConfValidationError

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

AdminExchangeConfValidationError is the validation error returned by AdminExchangeConf.Validate if the designated constraints aren't met.

func (AdminExchangeConfValidationError) Cause

Cause function returns cause value.

func (AdminExchangeConfValidationError) Error

Error satisfies the builtin error interface

func (AdminExchangeConfValidationError) ErrorName

ErrorName returns error name.

func (AdminExchangeConfValidationError) Field

Field function returns field value.

func (AdminExchangeConfValidationError) Key

Key function returns key value.

func (AdminExchangeConfValidationError) Reason

Reason function returns reason value.

type AdminQueueConf

type AdminQueueConf struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Durable    bool   `protobuf:"varint,3,opt,name=durable,proto3" json:"durable,omitempty"`
	AutoDelete bool   `protobuf:"varint,4,opt,name=autoDelete,proto3" json:"autoDelete,omitempty"`
	Exclusive  bool   `protobuf:"varint,5,opt,name=exclusive,proto3" json:"exclusive,omitempty"`
	NoWait     bool   `protobuf:"varint,6,opt,name=noWait,proto3" json:"noWait,omitempty"`
	// contains filtered or unexported fields
}

func (*AdminQueueConf) Descriptor deprecated

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

Deprecated: Use AdminQueueConf.ProtoReflect.Descriptor instead.

func (*AdminQueueConf) GetAutoDelete

func (x *AdminQueueConf) GetAutoDelete() bool

func (*AdminQueueConf) GetDurable

func (x *AdminQueueConf) GetDurable() bool

func (*AdminQueueConf) GetExclusive

func (x *AdminQueueConf) GetExclusive() bool

func (*AdminQueueConf) GetName

func (x *AdminQueueConf) GetName() string

func (*AdminQueueConf) GetNoWait

func (x *AdminQueueConf) GetNoWait() bool

func (*AdminQueueConf) ProtoMessage

func (*AdminQueueConf) ProtoMessage()

func (*AdminQueueConf) ProtoReflect

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

func (*AdminQueueConf) Reset

func (x *AdminQueueConf) Reset()

func (*AdminQueueConf) String

func (x *AdminQueueConf) String() string

func (*AdminQueueConf) Validate

func (m *AdminQueueConf) Validate() error

Validate checks the field values on AdminQueueConf 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 (*AdminQueueConf) ValidateAll

func (m *AdminQueueConf) ValidateAll() error

ValidateAll checks the field values on AdminQueueConf 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 AdminQueueConfMultiError, or nil if none found.

type AdminQueueConfMultiError

type AdminQueueConfMultiError []error

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

func (AdminQueueConfMultiError) AllErrors

func (m AdminQueueConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AdminQueueConfMultiError) Error

func (m AdminQueueConfMultiError) Error() string

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

type AdminQueueConfValidationError

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

AdminQueueConfValidationError is the validation error returned by AdminQueueConf.Validate if the designated constraints aren't met.

func (AdminQueueConfValidationError) Cause

Cause function returns cause value.

func (AdminQueueConfValidationError) Error

Error satisfies the builtin error interface

func (AdminQueueConfValidationError) ErrorName

func (e AdminQueueConfValidationError) ErrorName() string

ErrorName returns error name.

func (AdminQueueConfValidationError) Field

Field function returns field value.

func (AdminQueueConfValidationError) Key

Key function returns key value.

func (AdminQueueConfValidationError) Reason

Reason function returns reason value.

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

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

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

func (m ConsumerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConsumerConfMultiError) Error

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 Data

type Data struct {
	Md   map[string]string `` /* 145-byte string literal not displayed */
	Body []byte            `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Data) Descriptor deprecated

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

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetBody

func (x *Data) GetBody() []byte

func (*Data) GetMd

func (x *Data) GetMd() map[string]string

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect

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

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

func (*Data) Validate

func (m *Data) Validate() error

Validate checks the field values on Data 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 (*Data) ValidateAll

func (m *Data) ValidateAll() error

ValidateAll checks the field values on Data 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 DataMultiError, or nil if none found.

type DataMultiError

type DataMultiError []error

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

func (DataMultiError) AllErrors

func (m DataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DataMultiError) Error

func (m DataMultiError) Error() string

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

type DataValidationError

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

DataValidationError is the validation error returned by Data.Validate if the designated constraints aren't met.

func (DataValidationError) Cause

func (e DataValidationError) Cause() error

Cause function returns cause value.

func (DataValidationError) Error

func (e DataValidationError) Error() string

Error satisfies the builtin error interface

func (DataValidationError) ErrorName

func (e DataValidationError) ErrorName() string

ErrorName returns error name.

func (DataValidationError) Field

func (e DataValidationError) Field() string

Field function returns field value.

func (DataValidationError) Key

func (e DataValidationError) Key() bool

Key function returns key value.

func (DataValidationError) Reason

func (e DataValidationError) Reason() string

Reason function returns reason value.

type ErrorReason

type ErrorReason int32
const (
	ErrorReason_UNKOWN         ErrorReason = 0
	ErrorReason_DISCONNECT     ErrorReason = 1 // 断链接了
	ErrorReason_CHANNEL_CLOSED ErrorReason = 2 // channel 断了
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

func (ErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

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

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

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

func (m ExchangeConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExchangeConfMultiError) Error

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

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

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

func (m ListenerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListenerConfMultiError) Error

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

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

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

func (m ProducerConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ProducerConfMultiError) Error

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

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

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

func (m QueueConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (QueueConfMultiError) Error

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"`
	// contains filtered or unexported fields
}

func (*RabbitConf) Descriptor deprecated

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

Deprecated: Use RabbitConf.ProtoReflect.Descriptor instead.

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) URL

func (c *RabbitConf) URL() 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

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

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

func (m RabbitConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RabbitConfMultiError) Error

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 (*RabbitListener) Name

func (s *RabbitListener) Name() string

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

type Sender

type Sender interface {
	Name() string
	Send(ctx context.Context, header map[string]interface{}, exchange string, routeKey string, msg []byte) error
	Close() error
}

func MustNewSender

func MustNewSender(c *ProducerConf) Sender

Jump to

Keyboard shortcuts

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