Documentation ¶
Index ¶
- Constants
- func CreateChannel(insType string, topic, channel string) error
- func CreateTopic(insType string, topic string) error
- func DeferredPublishAsync(insType string, topic string, data []byte, ...) error
- func DeleteChannel(insType string, topic, channel string) error
- func DeleteTopic(insType string, topic string) error
- func Initialize(config *ManagerConfig)
- func PublishAsync(insType string, topic string, data []byte, ...) error
- type ConsumerClient
- type ConsumerConfig
- type Identify
- type Manager
- type ManagerConfig
- type NodeData
- type NodesData
- type ProducerClient
- type ProducerConfig
- type ProducerManager
- type ProducerManagerConfig
- type PublishData
Constants ¶
View Source
const ( DefaultUserAgent = "" DefaultMaxConcurrency = 1 DefaultMaxInFlight = 1 DefaultDialTimeout = 5 * time.Second DefaultReadTimeout = 1 * time.Minute DefaultWriteTimeout = 10 * time.Second DefaultLookupTimeout = 10 * time.Second DefaultMaxRetryTimeout = 10 * time.Second DefaultMinRetryTimeout = 10 * time.Millisecond DefaultDrainTimeout = 10 * time.Second NoTimeout = time.Duration(0) )
Variables ¶
This section is empty.
Functions ¶
func CreateChannel ¶ added in v1.0.4
func CreateTopic ¶ added in v1.0.4
func DeferredPublishAsync ¶ added in v1.0.4
func DeleteChannel ¶ added in v1.0.4
func DeleteTopic ¶ added in v1.0.4
func Initialize ¶ added in v1.0.4
func Initialize(config *ManagerConfig)
Types ¶
type ConsumerClient ¶
type ConsumerClient struct { NSQDAddresses []string // contains filtered or unexported fields }
func NewConsumerClient ¶
func NewConsumerClient(conf ConsumerConfig, cb func(c *nsq.Config)) *ConsumerClient
func (*ConsumerClient) AddHandle ¶
func (c *ConsumerClient) AddHandle(handler nsq.Handler)
type ConsumerConfig ¶
type Identify ¶
type Identify struct { // ClientID should be set to a unique identifier representing the client. ClientID string `json:"client_id"` // Hostname represents the hostname of the client, by default it is set to // the value returned by os.Hostname is used. Hostname string `json:"hostname"` // UserAgent represents the type of the client, by default it is set to // nsq.DefaultUserAgent. UserAgent string `json:"user_agent"` // MessageTimeout can bet set to configure the server-side message timeout // for messages delivered to this consumer. By default it is not sent to // the server. MessageTimeout time.Duration `json:"message_timeout"` }
Identify represents the IDENTIFY command.
type Manager ¶ added in v1.0.4
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) AddProducerManager ¶ added in v1.0.4
func (m *Manager) AddProducerManager(c *ProducerManagerConfig)
type ManagerConfig ¶ added in v1.0.4
type ManagerConfig struct {
Configs []*ProducerManagerConfig `json:"configs"`
}
type NodeData ¶ added in v1.0.4
type NodeData struct { RemoteAddr string `json:"remote_address"` HostName string `json:"hostname"` BroadcastAddr string `json:"broadcast_address"` TCPPort int `json:"tcp_port"` HTTPPort int `json:"http_port"` Version string `json:"version"` Tombstones interface{} `json:"tombstones"` Topics interface{} `json:"topics"` }
type ProducerClient ¶
type ProducerClient struct {
// contains filtered or unexported fields
}
func NewProducerClient ¶
func NewProducerClient(addr string) *ProducerClient
func (*ProducerClient) Pub ¶
func (c *ProducerClient) Pub(topicName string, body []byte)
func (*ProducerClient) Run ¶
func (c *ProducerClient) Run()
type ProducerConfig ¶
type ProducerManager ¶ added in v1.0.4
type ProducerManager struct {
// contains filtered or unexported fields
}
func NewProducerManager ¶ added in v1.0.4
func NewProducerManager(configs []*ProducerConfig, poolSize int) *ProducerManager
func (*ProducerManager) AddProducer ¶ added in v1.0.4
func (m *ProducerManager) AddProducer(address string)
func (*ProducerManager) GetProducer ¶ added in v1.0.4
func (m *ProducerManager) GetProducer() *ProducerClient
type ProducerManagerConfig ¶ added in v1.0.4
type ProducerManagerConfig struct { Category string `json:"category"` ProducerConfigs []*ProducerConfig `json:"producerConfigs"` PoolSize int }
type PublishData ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.