Documentation
¶
Index ¶
- Variables
- func RegisterConsumer(name string, factory ConsumerFactory)
- func RegisterPusher(name string, factory PusherFactory)
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetAcks() int32
- func (x *Conf) GetBroadcast() bool
- func (x *Conf) GetBrokers() []string
- func (x *Conf) GetExpression() string
- func (x *Conf) GetGroup() string
- func (x *Conf) GetNamespace() string
- func (x *Conf) GetNet() *Net
- func (x *Conf) GetOffset() string
- func (x *Conf) GetReadTimeout() *durationpb.Duration
- func (x *Conf) GetWriteTimeout() *durationpb.Duration
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- func (m *Conf) ValidateAll() error
- type ConfMultiError
- type ConfValidationError
- type ConsumeHandle
- type ConsumerFactory
- type MessageQueue
- type MessageQueueManager
- type Net
- func (*Net) Descriptor() ([]byte, []int)deprecated
- func (x *Net) GetSasl() *Net_SASL
- func (x *Net) GetTls() *Net_TLS
- func (*Net) ProtoMessage()
- func (x *Net) ProtoReflect() protoreflect.Message
- func (x *Net) Reset()
- func (x *Net) String() string
- func (m *Net) Validate() error
- func (m *Net) ValidateAll() error
- type NetMultiError
- type NetValidationError
- type Net_SASL
- func (*Net_SASL) Descriptor() ([]byte, []int)deprecated
- func (x *Net_SASL) GetEnable() bool
- func (x *Net_SASL) GetPassword() string
- func (x *Net_SASL) GetUser() string
- func (*Net_SASL) ProtoMessage()
- func (x *Net_SASL) ProtoReflect() protoreflect.Message
- func (x *Net_SASL) Reset()
- func (x *Net_SASL) String() string
- func (m *Net_SASL) Validate() error
- func (m *Net_SASL) ValidateAll() error
- type Net_SASLMultiError
- type Net_SASLValidationError
- type Net_TLS
- func (*Net_TLS) Descriptor() ([]byte, []int)deprecated
- func (x *Net_TLS) GetCert() string
- func (x *Net_TLS) GetEnable() bool
- func (x *Net_TLS) GetJks() string
- func (x *Net_TLS) GetKey() string
- func (x *Net_TLS) GetPassword() string
- func (x *Net_TLS) GetRootCa() string
- func (*Net_TLS) ProtoMessage()
- func (x *Net_TLS) ProtoReflect() protoreflect.Message
- func (x *Net_TLS) Reset()
- func (x *Net_TLS) String() string
- func (m *Net_TLS) Validate() error
- func (m *Net_TLS) ValidateAll() error
- type Net_TLSMultiError
- type Net_TLSValidationError
- type Pusher
- type PusherFactory
- type Registry
- type SubscribeOption
- type SubscribeOptions
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
var File_queue_conf_proto protoreflect.FileDescriptor
Functions ¶
func RegisterConsumer ¶ added in v0.1.1
func RegisterConsumer(name string, factory ConsumerFactory)
RegisterConsumer registers one discovery.
func RegisterPusher ¶ added in v0.1.1
func RegisterPusher(name string, factory PusherFactory)
Types ¶
type Conf ¶ added in v0.1.1
type Conf struct {
Brokers []string `protobuf:"bytes,1,rep,name=brokers,proto3" json:"brokers,omitempty"`
Net *Net `protobuf:"bytes,2,opt,name=net,proto3" json:"net,omitempty"`
Broadcast bool `protobuf:"varint,3,opt,name=broadcast,proto3" json:"broadcast,omitempty"`
Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
Expression string `protobuf:"bytes,6,opt,name=expression,proto3" json:"expression,omitempty"`
Group string `protobuf:"bytes,7,opt,name=group,proto3" json:"group,omitempty"`
Offset string `protobuf:"bytes,8,opt,name=offset,proto3" json:"offset,omitempty"`
ReadTimeout *durationpb.Duration `protobuf:"bytes,9,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"`
WriteTimeout *durationpb.Duration `protobuf:"bytes,10,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"`
Acks int32 `protobuf:"varint,11,opt,name=acks,proto3" json:"acks,omitempty"`
// contains filtered or unexported fields
}
func (*Conf) Descriptor
deprecated
added in
v0.1.1
func (*Conf) GetBroadcast ¶ added in v0.1.1
func (*Conf) GetBrokers ¶ added in v0.1.1
func (*Conf) GetExpression ¶ added in v0.1.1
func (*Conf) GetNamespace ¶ added in v0.1.1
func (*Conf) GetReadTimeout ¶ added in v0.1.1
func (x *Conf) GetReadTimeout() *durationpb.Duration
func (*Conf) GetWriteTimeout ¶ added in v0.1.1
func (x *Conf) GetWriteTimeout() *durationpb.Duration
func (*Conf) ProtoMessage ¶ added in v0.1.1
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶ added in v0.1.1
func (x *Conf) ProtoReflect() protoreflect.Message
func (*Conf) Validate ¶ added in v0.1.1
Validate checks the field values on Conf 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 (*Conf) ValidateAll ¶ added in v0.1.1
ValidateAll checks the field values on Conf 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 ConfMultiError, or nil if none found.
type ConfMultiError ¶ added in v0.1.1
type ConfMultiError []error
ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.
func (ConfMultiError) AllErrors ¶ added in v0.1.1
func (m ConfMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfMultiError) Error ¶ added in v0.1.1
func (m ConfMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfValidationError ¶ added in v0.1.1
type ConfValidationError struct {
// contains filtered or unexported fields
}
ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.
func (ConfValidationError) Cause ¶ added in v0.1.1
func (e ConfValidationError) Cause() error
Cause function returns cause value.
func (ConfValidationError) Error ¶ added in v0.1.1
func (e ConfValidationError) Error() string
Error satisfies the builtin error interface
func (ConfValidationError) ErrorName ¶ added in v0.1.1
func (e ConfValidationError) ErrorName() string
ErrorName returns error name.
func (ConfValidationError) Field ¶ added in v0.1.1
func (e ConfValidationError) Field() string
Field function returns field value.
func (ConfValidationError) Key ¶ added in v0.1.1
func (e ConfValidationError) Key() bool
Key function returns key value.
func (ConfValidationError) Reason ¶ added in v0.1.1
func (e ConfValidationError) Reason() string
Reason function returns reason value.
type ConsumeHandle ¶
type ConsumerFactory ¶ added in v0.1.1
type ConsumerFactory func(c *Conf) (MessageQueue, error)
type MessageQueue ¶
type MessageQueue interface {
Name() string
Subscribe(topic string, handler ConsumeHandle, opts ...SubscribeOption) (Subscriber, error)
Close() error
}
A MessageQueue interface represents a message queue.
func CreateConsumer ¶ added in v0.1.1
func CreateConsumer(name string, c *Conf) (MessageQueue, error)
CreateConsumer instantiates a discovery based on `discoveryDSN`.
type MessageQueueManager ¶ added in v0.1.1
type MessageQueueManager struct{}
func NewMessageQueueManager ¶ added in v0.1.1
func NewMessageQueueManager() *MessageQueueManager
type Net ¶ added in v0.1.1
type Net struct {
Sasl *Net_SASL `protobuf:"bytes,1,opt,name=sasl,proto3" json:"sasl,omitempty"`
Tls *Net_TLS `protobuf:"bytes,2,opt,name=tls,proto3" json:"tls,omitempty"`
// contains filtered or unexported fields
}
func (*Net) Descriptor
deprecated
added in
v0.1.1
func (*Net) ProtoMessage ¶ added in v0.1.1
func (*Net) ProtoMessage()
func (*Net) ProtoReflect ¶ added in v0.1.1
func (x *Net) ProtoReflect() protoreflect.Message
func (*Net) Validate ¶ added in v0.1.1
Validate checks the field values on Net 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 (*Net) ValidateAll ¶ added in v0.1.1
ValidateAll checks the field values on Net 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 NetMultiError, or nil if none found.
type NetMultiError ¶ added in v0.1.1
type NetMultiError []error
NetMultiError is an error wrapping multiple validation errors returned by Net.ValidateAll() if the designated constraints aren't met.
func (NetMultiError) AllErrors ¶ added in v0.1.1
func (m NetMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NetMultiError) Error ¶ added in v0.1.1
func (m NetMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NetValidationError ¶ added in v0.1.1
type NetValidationError struct {
// contains filtered or unexported fields
}
NetValidationError is the validation error returned by Net.Validate if the designated constraints aren't met.
func (NetValidationError) Cause ¶ added in v0.1.1
func (e NetValidationError) Cause() error
Cause function returns cause value.
func (NetValidationError) Error ¶ added in v0.1.1
func (e NetValidationError) Error() string
Error satisfies the builtin error interface
func (NetValidationError) ErrorName ¶ added in v0.1.1
func (e NetValidationError) ErrorName() string
ErrorName returns error name.
func (NetValidationError) Field ¶ added in v0.1.1
func (e NetValidationError) Field() string
Field function returns field value.
func (NetValidationError) Key ¶ added in v0.1.1
func (e NetValidationError) Key() bool
Key function returns key value.
func (NetValidationError) Reason ¶ added in v0.1.1
func (e NetValidationError) Reason() string
Reason function returns reason value.
type Net_SASL ¶ added in v0.1.1
type Net_SASL struct {
Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
// contains filtered or unexported fields
}
func (*Net_SASL) Descriptor
deprecated
added in
v0.1.1
func (*Net_SASL) GetPassword ¶ added in v0.1.1
func (*Net_SASL) ProtoMessage ¶ added in v0.1.1
func (*Net_SASL) ProtoMessage()
func (*Net_SASL) ProtoReflect ¶ added in v0.1.1
func (x *Net_SASL) ProtoReflect() protoreflect.Message
func (*Net_SASL) Validate ¶ added in v0.1.1
Validate checks the field values on Net_SASL 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 (*Net_SASL) ValidateAll ¶ added in v0.1.1
ValidateAll checks the field values on Net_SASL 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 Net_SASLMultiError, or nil if none found.
type Net_SASLMultiError ¶ added in v0.1.1
type Net_SASLMultiError []error
Net_SASLMultiError is an error wrapping multiple validation errors returned by Net_SASL.ValidateAll() if the designated constraints aren't met.
func (Net_SASLMultiError) AllErrors ¶ added in v0.1.1
func (m Net_SASLMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (Net_SASLMultiError) Error ¶ added in v0.1.1
func (m Net_SASLMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type Net_SASLValidationError ¶ added in v0.1.1
type Net_SASLValidationError struct {
// contains filtered or unexported fields
}
Net_SASLValidationError is the validation error returned by Net_SASL.Validate if the designated constraints aren't met.
func (Net_SASLValidationError) Cause ¶ added in v0.1.1
func (e Net_SASLValidationError) Cause() error
Cause function returns cause value.
func (Net_SASLValidationError) Error ¶ added in v0.1.1
func (e Net_SASLValidationError) Error() string
Error satisfies the builtin error interface
func (Net_SASLValidationError) ErrorName ¶ added in v0.1.1
func (e Net_SASLValidationError) ErrorName() string
ErrorName returns error name.
func (Net_SASLValidationError) Field ¶ added in v0.1.1
func (e Net_SASLValidationError) Field() string
Field function returns field value.
func (Net_SASLValidationError) Key ¶ added in v0.1.1
func (e Net_SASLValidationError) Key() bool
Key function returns key value.
func (Net_SASLValidationError) Reason ¶ added in v0.1.1
func (e Net_SASLValidationError) Reason() string
Reason function returns reason value.
type Net_TLS ¶ added in v0.1.1
type Net_TLS struct {
Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
RootCa string `protobuf:"bytes,2,opt,name=rootCa,proto3" json:"rootCa,omitempty"`
Jks string `protobuf:"bytes,3,opt,name=jks,proto3" json:"jks,omitempty"`
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
Cert string `protobuf:"bytes,5,opt,name=cert,proto3" json:"cert,omitempty"`
Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*Net_TLS) Descriptor
deprecated
added in
v0.1.1
func (*Net_TLS) GetPassword ¶ added in v0.1.1
func (*Net_TLS) ProtoMessage ¶ added in v0.1.1
func (*Net_TLS) ProtoMessage()
func (*Net_TLS) ProtoReflect ¶ added in v0.1.1
func (x *Net_TLS) ProtoReflect() protoreflect.Message
func (*Net_TLS) Validate ¶ added in v0.1.1
Validate checks the field values on Net_TLS 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 (*Net_TLS) ValidateAll ¶ added in v0.1.1
ValidateAll checks the field values on Net_TLS 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 Net_TLSMultiError, or nil if none found.
type Net_TLSMultiError ¶ added in v0.1.1
type Net_TLSMultiError []error
Net_TLSMultiError is an error wrapping multiple validation errors returned by Net_TLS.ValidateAll() if the designated constraints aren't met.
func (Net_TLSMultiError) AllErrors ¶ added in v0.1.1
func (m Net_TLSMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (Net_TLSMultiError) Error ¶ added in v0.1.1
func (m Net_TLSMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type Net_TLSValidationError ¶ added in v0.1.1
type Net_TLSValidationError struct {
// contains filtered or unexported fields
}
Net_TLSValidationError is the validation error returned by Net_TLS.Validate if the designated constraints aren't met.
func (Net_TLSValidationError) Cause ¶ added in v0.1.1
func (e Net_TLSValidationError) Cause() error
Cause function returns cause value.
func (Net_TLSValidationError) Error ¶ added in v0.1.1
func (e Net_TLSValidationError) Error() string
Error satisfies the builtin error interface
func (Net_TLSValidationError) ErrorName ¶ added in v0.1.1
func (e Net_TLSValidationError) ErrorName() string
ErrorName returns error name.
func (Net_TLSValidationError) Field ¶ added in v0.1.1
func (e Net_TLSValidationError) Field() string
Field function returns field value.
func (Net_TLSValidationError) Key ¶ added in v0.1.1
func (e Net_TLSValidationError) Key() bool
Key function returns key value.
func (Net_TLSValidationError) Reason ¶ added in v0.1.1
func (e Net_TLSValidationError) Reason() string
Reason function returns reason value.
type Pusher ¶
type Pusher interface {
Name() string
Push(ctx context.Context, topic string, key, value []byte) error
PushWithPartition(ctx context.Context, topic string, key, value []byte, partition int32) error
Close() error
}
A Pusher interface wraps the method Push.
type PusherFactory ¶ added in v0.1.1
type Registry ¶ added in v0.1.1
type Registry interface {
RegisterConsumer(name string, factory ConsumerFactory)
CreateConsumer(name string, c *Conf) (MessageQueue, error)
RegisterPusher(name string, factory PusherFactory)
CreatePusher(name string, c *Conf) (Pusher, error)
}
Registry is the interface for callers to get registered middleware.
func NewRegistry ¶ added in v0.1.1
func NewRegistry() Registry
NewRegistry returns a new middleware registry.
type SubscribeOption ¶ added in v0.1.1
type SubscribeOption func(*SubscribeOptions)
type SubscribeOptions ¶ added in v0.1.1
func NewSubscribeOptions ¶ added in v0.1.1
func NewSubscribeOptions(opts ...SubscribeOption) SubscribeOptions
func (*SubscribeOptions) Apply ¶ added in v0.1.1
func (o *SubscribeOptions) Apply(opts ...SubscribeOption)
type Subscriber ¶ added in v0.1.1
type Subscriber interface {
// Options .
Options() SubscribeOptions
// Topic .
Topic() string
// Unsubscribe .
Unsubscribe(removeFromManager bool) error
}
Subscriber .