Documentation
¶
Index ¶
- Constants
- func NewClient(ctx context.Context, config cmap.CustomMap) (busPluginTY.Plugin, error)
- func NewWebsocket(serverURL string, tlsConfig *tls.Config, timeout time.Duration, ...) (net.Conn, error)
- type Client
- func (c *Client) Close() error
- func (c *Client) Name() string
- func (c *Client) PausePublish()
- func (c *Client) Publish(topic string, data interface{}) error
- func (c *Client) QueueSubscribe(topic, queueName string, handler busPluginTY.CallBackFunc) (int64, error)
- func (c *Client) QueueUnsubscribe(topic, queueName string, subscriptionID int64) error
- func (c *Client) ResumePublish()
- func (c *Client) Subscribe(topic string, handler busPluginTY.CallBackFunc) (int64, error)
- func (c *Client) TopicPrefix() string
- func (c *Client) Unsubscribe(topic string, subscriptionID int64) error
- func (c *Client) UnsubscribeAll(topic string) error
- type Config
- type CustomDialer
- type WebsocketOptions
Constants ¶
View Source
const (
PluginNATSIO = "natsio"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct
func (*Client) PausePublish ¶
func (c *Client) PausePublish()
func (*Client) QueueSubscribe ¶
func (c *Client) QueueSubscribe(topic, queueName string, handler busPluginTY.CallBackFunc) (int64, error)
QueueSubscribe a topic with queue name
func (*Client) QueueUnsubscribe ¶
QueueUnsubscribe a topic
func (*Client) ResumePublish ¶
func (c *Client) ResumePublish()
func (*Client) Subscribe ¶
func (c *Client) Subscribe(topic string, handler busPluginTY.CallBackFunc) (int64, error)
Subscribe a topic
func (*Client) TopicPrefix ¶
func (*Client) Unsubscribe ¶
QueueUnsubscribe a topic
func (*Client) UnsubscribeAll ¶
UnsubscribeAll topics
type Config ¶
type Config struct {
Type string `yaml:"type"`
ServerURL string `yaml:"server_url"`
Token string `yaml:"token"`
Username string `yaml:"username"`
Password string `yaml:"password"`
Insecure bool `yaml:"insecure"`
BufferSize int `yaml:"buffer_size"`
RetryOnFailedConnect bool `yaml:"retry_on_failed_connect"`
ConnectionTimeout string `yaml:"connection_timeout"`
MaximumReconnect int `yaml:"maximum_reconnect"`
ReconnectWait string `yaml:"reconnect_wait"`
WebsocketOptions *WebsocketOptions `yaml:"websocket_options"`
TopicPrefix string `yaml:"topic_prefix"`
}
Config details of the client
type CustomDialer ¶
type CustomDialer struct {
// contains filtered or unexported fields
}
CustomDialer struct
func NewCustomDialer ¶
func NewCustomDialer(cfg *Config, logger *zap.Logger) (*CustomDialer, error)
NewCustomDialer returns a custom dialer
Click to show internal directories.
Click to hide internal directories.