-- import "github.com/autom8ter/gosub"
type GoSub struct {
}
GoSub provides google cloud pubsub
func NewGoSub(projectID string) (*GoSub, error)
NewGoSub creates a new GoSub instace for a project
func (g *GoSub) DeleteTopic(name string) error
func (g *GoSub) GetTopic(name string) (*pubsub.Topic, error)
func (g *GoSub) Publish(ctx context.Context, topic string, m *driver.Msg) error
Publish implements Publish
func (g *GoSub) Shutdown()
Shutdown shuts down all subscribers gracefully
func (g *GoSub) Subscribe(opts driver.HandlerOptions, h driver.MsgHandler)
Subscribe implements Subscribe
func (g *GoSub) TopicConfig(name string, ctx context.Context) (pubsub.TopicConfig, error)
func (g *GoSub) TopicExists(name string) (bool, error)
func (g *GoSub) TopicIAM(name string) (*iam.Handle, error)
func (g *GoSub) TopicSubscriptions(name string, ctx context.Context) (*pubsub.SubscriptionIterator, error)
func (g *GoSub) UpdateTopicConfig(name string, ctx context.Context, labels map[string]string) (pubsub.TopicConfig, error)
type MiddlewareFunctions struct {
SubscriberWare SubscriberWare
PublisherWare PublisherWare
}
func NewMiddlewareFunctions(subscriberWare SubscriberWare, publisherWare PublisherWare) *MiddlewareFunctions
func (m MiddlewareFunctions) PublisherMsgInterceptor(serviceName string, next driver.PublishHandler) driver.PublishHandler
func (m MiddlewareFunctions) SubscribeInterceptor(opts driver.HandlerOptions, next driver.MsgHandler) driver.MsgHandler
type PublisherWare func(serviceName string, next driver.PublishHandler) driver.PublishHandler
type SubscriberWare func(opts driver.HandlerOptions, next driver.MsgHandler) driver.MsgHandler