Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConOk = Status(0) ConFail = Status(1) )
View Source
const ( ConTypePush = Type(0) ConTypePull = Type(1) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { GroupID string `json:"groupId" yaml:"groupId" xml:"groupId"` Server string `json:"server" yaml:"server" xml:"server"` Domain string `json:"domain" yaml:"domain" xml:"domain"` GroupName string `json:"groupName" yaml:"groupName" xml:"groupName"` InstanceName string `json:"instance" yaml:"instance" xml:"instance"` }
type Config ¶
type Config struct { Client ClientConfig `json:"client" yaml:"client" xml:"client"` Credentials Credentials `json:"credentials" yaml:"credentials" xml:"credentials"` LogLevel int `json:"logLevel" yaml:"logLevel" xml:"logLevel"` ProducerConf ProducerConfig `json:"producer" yaml:"producer" xml:"producer"` ConsumerConf ConsumerConfig `json:"consumer" yaml:"consumer" xml:"consumer"` }
type Consumer ¶
type Consumer interface { Start() error Stop() //Subscribe 建议外面使用 go goroutine Subscribe(topic Topic, exp Expression, call func(msg *Message) Status) error }
func NewConsumer ¶
func NewPullConsumer ¶
func NewPushConsumer ¶
type ConsumerConfig ¶
type Credentials ¶
type Expression ¶
type Producer ¶
type Producer interface { Start() error Stop() SendJson(topic string, event interface{}) error SendBytes(topic string, data []byte) error SendAsync(topic string, data []byte) error }
func NewProducer ¶
type ProducerConfig ¶
Click to show internal directories.
Click to hide internal directories.