pkg

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMockUUID

func SetMockUUID(t *testing.T, uuid string) (clear func())

SetMockUUID mocks uuid with given string

func UUID

func UUID() string

UUID generates uuid

Types

type PubSubClient

type PubSubClient struct {
	*pubsub.Client
}

PubSubClient represents extended pubsub client

func NewPubSubClient

func NewPubSubClient(ctx context.Context, projectID, pubsubEmulatorHost, gcpCredFilePath string) (*PubSubClient, error)

NewPubSubClient initializes new pubsub client

func NewTestPubSubClient

func NewTestPubSubClient(t *testing.T) (*PubSubClient, error)

NewTestPubSubClient initializes new pubsub client for local pubsub emulator

func (*PubSubClient) CreateUniqueSubscription

func (pc *PubSubClient) CreateUniqueSubscription(ctx context.Context, topic *pubsub.Topic, ackDeadline time.Duration) (*pubsub.Subscription, error)

CreateUniqueSubscription creates an unique subscription to given topic

func (*PubSubClient) FindAllTopics added in v1.5.0

func (pc *PubSubClient) FindAllTopics(ctx context.Context) ([]*pubsub.Topic, error)

func (*PubSubClient) FindOrCreateTopic

func (pc *PubSubClient) FindOrCreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, bool, error)

FindOrCreateTopic finds the topic or create if not exists.

func (*PubSubClient) FindOrCreateTopics added in v1.5.0

func (pc *PubSubClient) FindOrCreateTopics(ctx context.Context, topicIDs []string) ([]*pubsub.Topic, error)

FindOrCreateTopics finds the given topics or creates if not exists. returned topics are unordered

func (*PubSubClient) FindTopic added in v1.5.2

func (pc *PubSubClient) FindTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)

FindTopic finds the topic or return nil if not exists.

func (*PubSubClient) FindTopics added in v1.5.2

func (pc *PubSubClient) FindTopics(ctx context.Context, topicIDs []string) ([]*pubsub.Topic, error)

FindTopics finds the given topics. returned topics are unordered

type UUIDGenerator

type UUIDGenerator interface {
	String() string
}

UUIDGenerator represents uuid generator

Jump to

Keyboard shortcuts

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