rocketmq

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: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_queue_rocketmq_conf_proto protoreflect.FileDescriptor

Functions

func MustNewQueue

func MustNewQueue(c *Conf, handler ConsumeHandler) queue.MessageQueue

func NewLogger

func NewLogger(core zapcore.Core) rlog.Logger

func NewQueue

func NewQueue(c *Conf, handler ConsumeHandler) (queue.MessageQueue, error)

Types

type Conf

type Conf struct {
	Addrs      []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"`
	AccessKey  string   `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"`
	SecretKey  string   `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"`
	Channel    string   `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel,omitempty"`
	GroupId    string   `protobuf:"bytes,5,opt,name=groupId,proto3" json:"groupId,omitempty"`
	Topic      string   `protobuf:"bytes,6,opt,name=topic,proto3" json:"topic,omitempty"`
	Expression string   `protobuf:"bytes,7,opt,name=expression,proto3" json:"expression,omitempty"`
	Broadcast  bool     `protobuf:"varint,8,opt,name=broadcast,proto3" json:"broadcast,omitempty"`
	Namespace  string   `protobuf:"bytes,9,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Conns      int32    `protobuf:"varint,10,opt,name=conns,proto3" json:"conns,omitempty"`
	// contains filtered or unexported fields
}

func (*Conf) Descriptor deprecated

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

Deprecated: Use Conf.ProtoReflect.Descriptor instead.

func (*Conf) GetAccessKey

func (x *Conf) GetAccessKey() string

func (*Conf) GetAddrs

func (x *Conf) GetAddrs() []string

func (*Conf) GetBroadcast

func (x *Conf) GetBroadcast() bool

func (*Conf) GetChannel

func (x *Conf) GetChannel() string

func (*Conf) GetConns

func (x *Conf) GetConns() int32

func (*Conf) GetExpression

func (x *Conf) GetExpression() string

func (*Conf) GetGroupId

func (x *Conf) GetGroupId() string

func (*Conf) GetNamespace

func (x *Conf) GetNamespace() string

func (*Conf) GetSecretKey

func (x *Conf) GetSecretKey() string

func (*Conf) GetTopic

func (x *Conf) GetTopic() string

func (*Conf) ProtoMessage

func (*Conf) ProtoMessage()

func (*Conf) ProtoReflect

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

func (*Conf) Reset

func (x *Conf) Reset()

func (*Conf) String

func (x *Conf) String() string

func (*Conf) Validate

func (m *Conf) Validate() error

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

func (m *Conf) ValidateAll() error

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

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

func (m ConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfMultiError) Error

func (m ConfMultiError) Error() string

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

type ConfValidationError

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

func (e ConfValidationError) Cause() error

Cause function returns cause value.

func (ConfValidationError) Error

func (e ConfValidationError) Error() string

Error satisfies the builtin error interface

func (ConfValidationError) ErrorName

func (e ConfValidationError) ErrorName() string

ErrorName returns error name.

func (ConfValidationError) Field

func (e ConfValidationError) Field() string

Field function returns field value.

func (ConfValidationError) Key

func (e ConfValidationError) Key() bool

Key function returns key value.

func (ConfValidationError) Reason

func (e ConfValidationError) Reason() string

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 MessageExtTextMapCarrier

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

func (*MessageExtTextMapCarrier) Get

func (carrier *MessageExtTextMapCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (*MessageExtTextMapCarrier) Keys

func (carrier *MessageExtTextMapCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (*MessageExtTextMapCarrier) Set

func (carrier *MessageExtTextMapCarrier) Set(key string, value string)

Set stores the key-value pair.

type MessageTextMapCarrier

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

func (*MessageTextMapCarrier) Get

func (carrier *MessageTextMapCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (*MessageTextMapCarrier) Keys

func (carrier *MessageTextMapCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (*MessageTextMapCarrier) Set

func (carrier *MessageTextMapCarrier) Set(key string, value string)

Set stores the key-value pair.

type Pusher

type Pusher interface {
	Name() string
	Push(ctx context.Context, topic string, key, value []byte) error
	Close() error
}

A Pusher interface wraps the method Push.

func MustNewPusher

func MustNewPusher(c *Conf) Pusher

func NewPusher

func NewPusher(config *Conf) (Pusher, error)

type RocketLogger

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

func (RocketLogger) Debug

func (l RocketLogger) Debug(msg string, fields map[string]interface{})

func (RocketLogger) Enabled

func (l RocketLogger) Enabled(lvl zapcore.Level) bool

func (RocketLogger) Error

func (l RocketLogger) Error(msg string, fields map[string]interface{})

func (RocketLogger) Fatal

func (l RocketLogger) Fatal(msg string, fields map[string]interface{})

func (RocketLogger) Info

func (l RocketLogger) Info(msg string, fields map[string]interface{})

func (*RocketLogger) Level

func (l *RocketLogger) Level(level string)

func (RocketLogger) OutputPath

func (l RocketLogger) OutputPath(path string) (err error)

func (RocketLogger) Warning

func (l RocketLogger) Warning(msg string, fields map[string]interface{})

Jump to

Keyboard shortcuts

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