github.com/micro/go-micro/v2@v2.9.1/event.go (about)

     1  package micro
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/micro/go-micro/v2/client"
     7  )
     8  
     9  type event struct {
    10  	c     client.Client
    11  	topic string
    12  }
    13  
    14  func (e *event) Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error {
    15  	return e.c.Publish(ctx, e.c.NewMessage(e.topic, msg), opts...)
    16  }