mq

package
v0.0.0-...-532f06c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: LGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageAttrTopic           = "nekoq.topic"
	MessageAttrBindingKey      = "nekoq.binding_key"
	MessageAttrReplyId         = "nekoq.reply.reply_id"
	MessageAttrReplyIdentifier = "nekoq.reply.reply_identifier"
)
View Source
const (
	DeliveryTypeAtMostOnce  = "at_most_once"
	DeliveryTypeAtLeastOnce = "at_least_once"
	DeliveryTypeExactlyOnce = "exactly_once"
)
View Source
const (
	ResponseOperationMessage          = "message"
	ResponseOperationMessageReleasing = "message_releasing"
	ResponseOperationReply            = "reply"
)

Variables

View Source
var (
	ErrDefinitionMismatch    = errors.New("definition mismatch")
	ErrInvalidInputParameter = errors.New("invalid input parameter")
	ErrComponentNotExist     = errors.New("component not exist")
)

Functions

func ConcatNames

func ConcatNames(strs ...string) string

func DebugJsonPrint

func DebugJsonPrint(i interface{})

func GetBroker

func GetBroker() mqapi.Broker

func GetMetadataContainer

func GetMetadataContainer() *metadataContainer

func InitBroker

func InitBroker() error

func LoadMetadata

func LoadMetadata() error

func Run

func Run(listener string) error

func ValidateNameForBrokerMechanisms

func ValidateNameForBrokerMechanisms(v string) bool

func ValidateNameForBrokerMechanismsWithWildcard

func ValidateNameForBrokerMechanismsWithWildcard(v string) bool

Types

type AckDef

type AckDef struct {
	SubscribeGroup string      `json:"subscribe_group"`
	Queue          string      `json:"queue"`
	MessageId      mqapi.MsgId `json:"message_id"`

	ReplyId         string `json:"reply_id"`
	ReplyIdentifier string `json:"reply_identifier"`
	Payload         []byte `json:"payload"`
}

type BindDef

type BindDef struct {
	Topic      string `json:"topic"`
	Queue      string `json:"queue"`
	BindingKey string `json:"binding_key"`
}

type GeneralReq

type GeneralReq struct {
	Operation string `json:"operation"`
	RequestId string `json:"request_id"`

	NewTopic          *TopicDef          `json:"new_topic,omitempty"`
	NewQueue          *QueueDef          `json:"new_queue,omitempty"`
	NewBinding        *BindDef           `json:"new_binding,omitempty"`
	NewPublishGroup   *PublishGroupDef   `json:"new_publish_group,omitempty"`
	NewSubscribeGroup *SubscribeGroupDef `json:"new_subscribe_group,omitempty"`
	NewMessage        *MessageDef        `json:"new_message,omitempty"`
	NewMessageCommit  *MessageDescDef    `json:"new_message_commit,omitempty"`
	AckMessage        *AckDef            `json:"ack_message,omitempty"`
	ReleaseMessage    *ReleaseDef        `json:"release_message,omitempty"`
}

type GeneralRes

type GeneralRes struct {
	Status    string `json:"status"`
	Info      string `json:"info"`
	RequestId string `json:"request_id"`

	PublishGroupResponse   *PublishGroupRes   `json:"publish_group_res,omitempty"`
	SubscribeGroupResponse *SubscribeGroupRes `json:"subscribe_group_res,omitempty"`

	NewMessageResponse *NewMessageRes `json:"new_message,omitempty"`

	Operation               *string                  `json:"operation,omitempty"`
	WrittenMessage          *WrittenMessage          `json:"message,omitempty"`
	WrittenMessageReleasing *WrittenMessageReleasing `json:"message_releasing,omitempty"`
	WrittenReply            *WrittenReply            `json:"reply,omitempty"`
}

type MessageDef

type MessageDef struct {
	Topic        string `json:"topic"`
	PublishGroup string `json:"publish_group"`
	BindingKey   string `json:"binding_key"`
	RpcMeta      *struct {
		ReplyIdentifier string `json:"reply_identifier"`
	} `json:"rpc_meta"`

	Payload []byte `json:"payload"`
}

type MessageDescDef

type MessageDescDef struct {
	MessageIdList []struct {
		MsgId idgen.IdType `json:"msg_id"`
		OutId idgen.IdType `json:"out_id"`
	} `json:"message_id_list"`
	Topic        string `json:"topic"`
	BindingKey   string `json:"binding_key"`
	PublishGroup string `json:"publish_group"`
}

type NewMessageRes

type NewMessageRes struct {
	MessageIdList []struct {
		MsgId idgen.IdType `json:"msg_id"`
		OutId idgen.IdType `json:"out_id"`
	} `json:"message_id_list"`
	Topic      string `json:"topic"`
	BindingKey string `json:"binding_key"`
}

type PublishGroupDef

type PublishGroupDef struct {
	Topic        string `json:"topic"`
	PublishGroup string `json:"publish_group"`
}

type PublishGroupRes

type PublishGroupRes struct {
	PublishGroup string `json:"publish_group"`
}

type QueueDef

type QueueDef struct {
	Queue             string `json:"queue"`
	DeliveryLevelType string `json:"delivery_level_type"`
}

type ReleaseDef

type ReleaseDef struct {
	SubscribeGroup string      `json:"subscribe_group"`
	Queue          string      `json:"queue"`
	MessageId      mqapi.MsgId `json:"message_id"`

	ReplyId         string `json:"reply_id"`
	ReplyIdentifier string `json:"reply_identifier"`
	Payload         []byte `json:"payload"`
}

type StoredBinding

type StoredBinding struct {
	TopicId mqapi.TopicId
	QueueId mqapi.QueueId
	Tag     mqapi.TagId
}

type SubscribeGroupDef

type SubscribeGroupDef struct {
	Queue          string `json:"queue"`
	SubscribeGroup string `json:"subscribe_group"`
}

type SubscribeGroupRes

type SubscribeGroupRes struct {
	SubscribeGroup string `json:"subscribe_group"`
}

type TopicDef

type TopicDef struct {
	Topic             string `json:"topic"`
	DeliveryLevelType string `json:"delivery_level_type"`
}

type WrittenMessage

type WrittenMessage struct {
	Topic          string      `json:"topic"`
	Queue          string      `json:"queue"`
	BindingKey     string      `json:"binding_key"`
	SubscribeGroup string      `json:"subscribe_group"`
	MessageId      mqapi.MsgId `json:"message_id"`
	Payload        []byte      `json:"payload"`

	ReplyId         string `json:"reply_id"`
	ReplyIdentifier string `json:"reply_identifier"`
}

type WrittenMessageReleasing

type WrittenMessageReleasing struct {
	Topic          string      `json:"topic"`
	Queue          string      `json:"queue"`
	BindingKey     string      `json:"binding_key"`
	SubscribeGroup string      `json:"subscribe_group"`
	MessageId      mqapi.MsgId `json:"message_id"`

	ReplyId         string `json:"reply_id"`
	ReplyIdentifier string `json:"reply_identifier"`
}

type WrittenReply

type WrittenReply struct {
	ReplyId         idgen.IdType `json:"reply_id"`
	ReplyIdentifier string       `json:"reply_identifier"`
	Payload         []byte       `json:"payload"`
}

Jump to

Keyboard shortcuts

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