Documentation ¶
Index ¶
- func SetMockUUID(t *testing.T, uuid string) (clear func())
- func UUID() string
- type PubSubClient
- func (pc *PubSubClient) CreateUniqueSubscription(ctx context.Context, topic *pubsub.Topic, ackDeadline time.Duration) (*pubsub.Subscription, error)
- func (pc *PubSubClient) FindAllTopics(ctx context.Context) ([]*pubsub.Topic, error)
- func (pc *PubSubClient) FindOrCreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, bool, error)
- func (pc *PubSubClient) FindOrCreateTopics(ctx context.Context, topicIDs []string) ([]*pubsub.Topic, error)
- func (pc *PubSubClient) FindTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)
- func (pc *PubSubClient) FindTopics(ctx context.Context, topicIDs []string) ([]*pubsub.Topic, error)
- type UUIDGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMockUUID ¶
SetMockUUID mocks uuid with given string
Types ¶
type PubSubClient ¶
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 (*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
FindTopic finds the topic or return nil if not exists.
func (*PubSubClient) FindTopics ¶ added in v1.5.2
FindTopics finds the given topics. returned topics are unordered
type UUIDGenerator ¶
type UUIDGenerator interface {
String() string
}
UUIDGenerator represents uuid generator
Click to show internal directories.
Click to hide internal directories.