#97-v3 #299
@ -8,7 +8,6 @@ import (
|
||||
|
||||
"go.unistack.org/micro/v3/broker"
|
||||
"go.unistack.org/micro/v3/fsm"
|
||||
"go.unistack.org/micro/v3/options"
|
||||
)
|
||||
|
||||
func TestAs(t *testing.T) {
|
||||
@ -65,8 +64,9 @@ type bro struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (p *bro) Name() string { return p.name }
|
||||
func (p *bro) Init(opts ...options.Option) error { return nil }
|
||||
func (p *bro) Name() string { return p.name }
|
||||
|
||||
func (p *bro) Init(opts ...broker.Option) error { return nil }
|
||||
|
||||
// Options returns broker options
|
||||
func (p *bro) Options() broker.Options { return broker.Options{} }
|
||||
@ -81,10 +81,22 @@ func (p *bro) Connect(ctx context.Context) error { return nil }
|
||||
func (p *bro) Disconnect(ctx context.Context) error { return nil }
|
||||
|
||||
// Publish message, msg can be single broker.Message or []broker.Message
|
||||
func (p *bro) Publish(ctx context.Context, msg interface{}, opts ...options.Option) error { return nil }
|
||||
func (p *bro) Publish(ctx context.Context, topic string, msg *broker.Message, opts ...broker.PublishOption) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BatchPublish messages to broker with multiple topics
|
||||
func (p *bro) BatchPublish(ctx context.Context, msgs []*broker.Message, opts ...broker.PublishOption) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BatchSubscribe subscribes to topic messages via handler
|
||||
func (p *bro) BatchSubscribe(ctx context.Context, topic string, h broker.BatchHandler, opts ...broker.SubscribeOption) (broker.Subscriber, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Subscribe subscribes to topic message via handler
|
||||
func (p *bro) Subscribe(ctx context.Context, topic string, handler interface{}, opts ...options.Option) (broker.Subscriber, error) {
|
||||
func (p *bro) Subscribe(ctx context.Context, topic string, handler broker.Handler, opts ...broker.SubscribeOption) (broker.Subscriber, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user