fakepubsub

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Creator

func Creator(value interface{}) util.PubSubClientCreator

Types

type Client

type Client struct {
	Data ClientData
}

func (*Client) CreateSubscription

func (c *Client) CreateSubscription(ctx context.Context, id string, topic util.PubSubTopic) (util.PubSubSubscription, error)

func (*Client) CreateTopic

func (c *Client) CreateTopic(ctx context.Context, id string) (util.PubSubTopic, error)

func (*Client) SubscriptionInProject

func (c *Client) SubscriptionInProject(id, projectId string) util.PubSubSubscription

func (*Client) Topic

func (c *Client) Topic(id string) util.PubSubTopic

type ClientData

type ClientData struct {
	SubscriptionData SubscriptionData
	CreateSubErr     error
	TopicData        TopicData
	CreateTopicErr   error
}

type CreatorData

type CreatorData struct {
	ClientCreateErr error
	ClientData      ClientData
}

type Message

type Message struct {
	MessageData MessageData
}

func (*Message) Ack

func (m *Message) Ack()

func (*Message) Attributes

func (m *Message) Attributes() map[string]string

func (*Message) Data

func (m *Message) Data() []byte

func (*Message) ID

func (m *Message) ID() string

func (*Message) Nack

func (m *Message) Nack()

type MessageData

type MessageData struct {
	Ack  bool
	Nack bool
}

type PublishResult

type PublishResult struct {
	Data PublishResultData
}

func (*PublishResult) Get

func (r *PublishResult) Get(ctx context.Context) (serverID string, err error)

func (*PublishResult) Ready

func (r *PublishResult) Ready() <-chan struct{}

type PublishResultData

type PublishResultData struct {
	ID    string
	Err   error
	Ready <-chan struct{}
}

type Subscription

type Subscription struct {
	Data SubscriptionData
}

func (*Subscription) Delete

func (s *Subscription) Delete(ctx context.Context) error

func (*Subscription) Exists

func (s *Subscription) Exists(ctx context.Context) (bool, error)

func (*Subscription) ID

func (s *Subscription) ID() string

func (*Subscription) Receive

func (s *Subscription) Receive(ctx context.Context, f func(context.Context, util.PubSubMessage)) error

type SubscriptionData

type SubscriptionData struct {
	Exists     bool
	ExistsErr  error
	DeleteErr  error
	ReceiveErr error

	ReceiveFunc func(context.Context, util.PubSubMessage)
}

type Topic

type Topic struct {
	Data TopicData
}

func (*Topic) Delete

func (t *Topic) Delete(ctx context.Context) error

func (*Topic) Exists

func (t *Topic) Exists(ctx context.Context) (bool, error)

func (*Topic) ID

func (t *Topic) ID() string

func (*Topic) Publish

func (t *Topic) Publish(ctx context.Context, msg *pubsub.Message) util.PubSubPublishResult

func (*Topic) Stop

func (t *Topic) Stop()

type TopicData

type TopicData struct {
	Exists    bool
	ExistsErr error

	DeleteErr error
	Publish   PublishResultData

	Stop bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL