event

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const EXPR = "^[0-9a-zA-Z-_]{3,64}$"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BusinessName string
	RegionId     string
	AccessKey    string
	SecretKey    string
	InstanceId   string
	HttpEndpoint string
}

type EventConsumer

type EventConsumer struct {
	mq_http_sdk.MQConsumer
	// contains filtered or unexported fields
}

type EventProducer

type EventProducer struct {
	mq_http_sdk.MQProducer
	// contains filtered or unexported fields
}

type EventServer

type EventServer struct {
	*mq_http_sdk.AliyunMQClient
	// contains filtered or unexported fields
}

func NewEventServer

func NewEventServer(config *Config, logger log.LoggerContextIface) (*EventServer, error)

func (*EventServer) Publish

func (h *EventServer) Publish(msg *Message) (string, error)

发布消息

func (*EventServer) Start

func (h *EventServer) Start() error

开始事件处理

func (*EventServer) Subscribe

func (h *EventServer) Subscribe(toipc, tag, consumer string, handler interface{}) error

订阅消息

type EventServerIface

type EventServerIface interface {
	Subscribe(toipc, tag, consumer string, handler interface{}) error
}

type Message

type Message struct {
	// 话题
	Topic string
	// 标签
	Tag string
	// 消息键
	Key string
	// 消息体
	Body interface{}
}

type ProducerIface

type ProducerIface interface {
	Publish(msg *Message) (string, error)
}

Jump to

Keyboard shortcuts

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