Skip to content

autom8ter/gosub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gosub

-- import "github.com/autom8ter/gosub"

Usage

type GoSub

type GoSub struct {
}

GoSub provides google cloud pubsub

func NewGoSub

func NewGoSub(projectID string) (*GoSub, error)

NewGoSub creates a new GoSub instace for a project

func (*GoSub) DeleteTopic

func (g *GoSub) DeleteTopic(name string) error

func (*GoSub) GetTopic

func (g *GoSub) GetTopic(name string) (*pubsub.Topic, error)

func (*GoSub) Publish

func (g *GoSub) Publish(ctx context.Context, topic string, m *driver.Msg) error

Publish implements Publish

func (*GoSub) Shutdown

func (g *GoSub) Shutdown()

Shutdown shuts down all subscribers gracefully

func (*GoSub) Subscribe

func (g *GoSub) Subscribe(opts driver.HandlerOptions, h driver.MsgHandler)

Subscribe implements Subscribe

func (*GoSub) TopicConfig

func (g *GoSub) TopicConfig(name string, ctx context.Context) (pubsub.TopicConfig, error)

func (*GoSub) TopicExists

func (g *GoSub) TopicExists(name string) (bool, error)

func (*GoSub) TopicIAM

func (g *GoSub) TopicIAM(name string) (*iam.Handle, error)

func (*GoSub) TopicSubscriptions

func (g *GoSub) TopicSubscriptions(name string, ctx context.Context) (*pubsub.SubscriptionIterator, error)

func (*GoSub) UpdateTopicConfig

func (g *GoSub) UpdateTopicConfig(name string, ctx context.Context, labels map[string]string) (pubsub.TopicConfig, error)

type MiddlewareFunctions

type MiddlewareFunctions struct {
	SubscriberWare SubscriberWare
	PublisherWare  PublisherWare
}

func NewMiddlewareFunctions

func NewMiddlewareFunctions(subscriberWare SubscriberWare, publisherWare PublisherWare) *MiddlewareFunctions

func (MiddlewareFunctions) PublisherMsgInterceptor

func (m MiddlewareFunctions) PublisherMsgInterceptor(serviceName string, next driver.PublishHandler) driver.PublishHandler

func (MiddlewareFunctions) SubscribeInterceptor

func (m MiddlewareFunctions) SubscribeInterceptor(opts driver.HandlerOptions, next driver.MsgHandler) driver.MsgHandler

type PublisherWare

type PublisherWare func(serviceName string, next driver.PublishHandler) driver.PublishHandler

type SubscriberWare

type SubscriberWare func(opts driver.HandlerOptions, next driver.MsgHandler) driver.MsgHandler