Documentation ¶
Overview ¶
package google provide structures to catch/send message to pubsub instance
Index ¶
- Variables
- func Debug() error
- func NoLog()
- func Reset() error
- func ResetLog()
- type Client
- func (ps *Client) AssertMessageMetadata(data *godog.Table, within time.Duration) error
- func (ps *Client) AssertMessageReceived(data *godog.Table, within time.Duration) error
- func (ps *Client) AssertXMessageData(position int, expectedMessage *godog.Table) error
- func (ps *Client) AssertXMessageMetadata(position int, expectedMetadata *godog.Table) error
- func (ps *Client) Persist(store *picker.Store)
- func (ps *Client) ReceiveOn(subscription string, acknowledgeOnReception bool) error
- func (ps *Client) Reset()
- func (ps *Client) SeedFromFile(filePath string, store *picker.Store) error
- func (ps *Client) Send(topic string, data *godog.DocString) error
- type Manifest
- type Message
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoMatch = errors.New("no match") ErrUnknownMessage = errors.New("positions does not match a known message") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a structure to manage GCP instances.
func Pubsub ¶
Pubsub initializes a Client instance for GCP pubsub. It will persists instance using provided name to be injectable through {{gcp.name}} in gherkin steps.
Providing an empty picker does not impact initialization. It will just not picked the instance.
You can always call Client.Persist to save client instance in a picker store.
func (*Client) AssertMessageMetadata ¶
AssertMessageMetadata assert pubsub client received a message metadata matching providing assertions from godog.Table.
/!\ It does not apply filters to message data.
func (*Client) AssertMessageReceived ¶
AssertMessageReceived assert pubsub client received a message matching providing assertions from godog.Table.
/!\ It does not apply filters to message metadata.
func (*Client) AssertXMessageData ¶
AssertXMessageData assert pubsub client Xth message data matches provided conditions.
/!\ It does not apply filters to message metadata.
func (*Client) AssertXMessageMetadata ¶
AssertXMessageMetadata assert pubsub client Xth message metadata matches provided conditions.
/!\ It does not apply filters to message data.
func (*Client) Persist ¶
Persist persists client instance through picker instance using gcp.name key.
func (*Client) ReceiveOn ¶
ReceiveOn set up pubsub message reception from subscription. Messages will be stored in a slice until Client.Reset is called.