Documentation ¶
Index ¶
- Constants
- func PrefixSize(size int) topicOptionFunc
- func Topic(name string, funcs ...topicOptionFunc) *topicNameOptionTuple
- func Topics(topics ...*topicNameOptionTuple) map[string]RelayClientConfig
- func WorkerNum(num int) topicOptionFunc
- type DefaultServer
- type Destination
- type MultipleSource
- type MultipleSourceSingleDestinationRelay
- type Relay
- type RelayClientConfig
- type RelayConfig
- type Server
- type ServerOptFunc
- type SingleDestination
- type Source
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func PrefixSize ¶ added in v1.6.0
func PrefixSize(size int) topicOptionFunc
func Topic ¶ added in v1.6.0
func Topic(name string, funcs ...topicOptionFunc) *topicNameOptionTuple
func Topics ¶ added in v1.6.0
func Topics(topics ...*topicNameOptionTuple) map[string]RelayClientConfig
Types ¶
type DefaultServer ¶ added in v1.7.0
type DefaultServer struct {
// contains filtered or unexported fields
}
func NewDefaultServer ¶ added in v1.7.0
func NewDefaultServer(funcs ...ServerOptFunc) *DefaultServer
type Destination ¶ added in v1.7.0
type MultipleSource ¶ added in v1.7.0
type MultipleSource struct {
// contains filtered or unexported fields
}
func NewMultipleSource ¶ added in v1.7.0
func NewMultipleSource(urls []string, natsOpts []nats.Option, logger *log.Logger) *MultipleSource
func (*MultipleSource) Close ¶ added in v1.7.0
func (s *MultipleSource) Close() error
func (*MultipleSource) Open ¶ added in v1.7.0
func (s *MultipleSource) Open() error
func (*MultipleSource) Unsubscribe ¶ added in v1.7.0
func (s *MultipleSource) Unsubscribe() error
type MultipleSourceSingleDestinationRelay ¶ added in v1.7.0
type MultipleSourceSingleDestinationRelay struct {
// contains filtered or unexported fields
}
func NewMultipleSourceSingleDestinationRelay ¶ added in v1.7.0
func NewMultipleSourceSingleDestinationRelay(topic string, src Source, dst Destination, prefix, num int, logger *log.Logger) *MultipleSourceSingleDestinationRelay
type RelayClientConfig ¶
type RelayConfig ¶
type RelayConfig struct { PrimaryUrl string `yaml:"primary"` SecondaryUrl string `yaml:"secondary"` NatsUrl string `yaml:"nats"` Topics map[string]RelayClientConfig `yaml:"topic"` }
relay.yaml ---------- primary: "nats://master1.example.com:4222/" secondary: "nats://master2.example.com:4222/" nats: "nats://localhost:4222/" topic:
"foo.>": worker: 2 "bar.>": worker: 2
type ServerOptFunc ¶ added in v1.7.0
type ServerOptFunc func(*serverOpt)
func ServerOptExecutor ¶ added in v1.7.0
func ServerOptExecutor(executor *chanque.Executor) ServerOptFunc
func ServerOptLogger ¶ added in v1.7.0
func ServerOptLogger(logger *log.Logger) ServerOptFunc
func ServerOptNatsOptions ¶ added in v1.7.0
func ServerOptNatsOptions(natsOpts ...nats.Option) ServerOptFunc
func ServerOptRelayConfig ¶ added in v1.7.0
func ServerOptRelayConfig(conf RelayConfig) ServerOptFunc
type SingleDestination ¶ added in v1.7.0
type SingleDestination struct {
// contains filtered or unexported fields
}
func NewSingleDestination ¶ added in v1.7.0
func (*SingleDestination) Close ¶ added in v1.7.0
func (d *SingleDestination) Close() error
func (*SingleDestination) Open ¶ added in v1.7.0
func (d *SingleDestination) Open(num int) error
func (*SingleDestination) Workers ¶ added in v1.7.0
func (d *SingleDestination) Workers() []chanque.Worker
Source Files ¶
Click to show internal directories.
Click to hide internal directories.