Documentation ¶
Index ¶
- type Config
- type PubSubDriver
- func (p *PubSubDriver) Connections(topic string, res map[string]struct{})
- func (p *PubSubDriver) Next(ctx context.Context) (*pubsub.Message, error)
- func (p *PubSubDriver) Publish(msg *pubsub.Message) error
- func (p *PubSubDriver) PublishAsync(msg *pubsub.Message)
- func (p *PubSubDriver) Subscribe(connectionID string, topics ...string) error
- func (p *PubSubDriver) Unsubscribe(connectionID string, topics ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addrs []string `mapstructure:"addrs"` DB int `mapstructure:"db"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` MasterName string `mapstructure:"master_name"` SentinelPassword string `mapstructure:"sentinel_password"` RouteByLatency bool `mapstructure:"route_by_latency"` RouteRandomly bool `mapstructure:"route_randomly"` MaxRetries int `mapstructure:"max_retries"` DialTimeout time.Duration `mapstructure:"dial_timeout"` MinRetryBackoff time.Duration `mapstructure:"min_retry_backoff"` MaxRetryBackoff time.Duration `mapstructure:"max_retry_backoff"` PoolSize int `mapstructure:"pool_size"` MinIdleConns int `mapstructure:"min_idle_conns"` MaxConnAge time.Duration `mapstructure:"max_conn_age"` ReadTimeout time.Duration `mapstructure:"read_timeout"` WriteTimeout time.Duration `mapstructure:"write_timeout"` PoolTimeout time.Duration `mapstructure:"pool_timeout"` IdleTimeout time.Duration `mapstructure:"idle_timeout"` IdleCheckFreq time.Duration `mapstructure:"idle_check_freq"` ReadOnly bool `mapstructure:"read_only"` }
func (*Config) InitDefaults ¶
func (s *Config) InitDefaults()
InitDefaults initializing fill config with default values
type PubSubDriver ¶
func NewPubSubDriver ¶
func NewPubSubDriver(log logger.Logger, key string, cfgPlugin config.Configurer, stopCh chan struct{}) (*PubSubDriver, error)
func (*PubSubDriver) Connections ¶
func (p *PubSubDriver) Connections(topic string, res map[string]struct{})
func (*PubSubDriver) PublishAsync ¶
func (p *PubSubDriver) PublishAsync(msg *pubsub.Message)
func (*PubSubDriver) Subscribe ¶
func (p *PubSubDriver) Subscribe(connectionID string, topics ...string) error
func (*PubSubDriver) Unsubscribe ¶
func (p *PubSubDriver) Unsubscribe(connectionID string, topics ...string) error
Click to show internal directories.
Click to hide internal directories.