# README

Wire

This directory contains internal implementation details for Pub/Sub Lite.

Conventions

The following are general conventions used in this package:

  • Capitalized methods and fields of a struct denotes its public interface. They are safe to call from outside the struct (e.g. accesses immutable fields or guarded by a mutex). All other methods are considered internal implementation details that should not be called from outside the struct.
  • unsafeFoo() methods indicate that the caller is expected to have already acquired the struct's mutex. Since Go does not support re-entrant locks, they do not acquire the mutex. These are typically common util methods that need to be atomic with other operations.

# Functions

LocationToRegion returns the region that the given location is in.
NewAdminClient creates a new gapic AdminClient for a region.
NewPartitionSet creates a partition set initialized from the given partition numbers.
NewPublisher creates a new client for publishing messages.
NewSubscriber creates a new client for receiving messages.
ParseLocationPath parses a project/location path.
ParseReservationPath parses the full path of a Pub/Sub Lite reservation.
ParseSubscriptionPath parses the full path of a Pub/Sub Lite subscription.
ParseTopicPath parses the full path of a Pub/Sub Lite topic.
ValidateRegion verifies that the `input` string has the format of a valid Google Cloud region.

# Constants

FrameworkCloudPubSubShim is the API that emulates Cloud Pub/Sub.
MaxPublishRequestBytes is the maximum allowed serialized size of a single publish request (containing a batch of messages) in bytes.
MaxPublishRequestCount is the maximum number of messages that can be batched in a single publish request.
MinTimeout is the minimum timeout value that can be set for publisher and subscriber settings.

# Variables

DefaultPublishSettings holds the default values for PublishSettings.
DefaultReceiveSettings holds the default values for ReceiveSettings.
ErrBackendUnavailable indicates that the backend service has been unavailable for a period of time.
ErrOverflow indicates that the publish buffers have overflowed.
ErrOversizedMessage indicates that the user published a message over the allowed serialized byte size limit.
ErrServiceStarting indicates that a service (e.g.
ErrServiceStopped indicates that a service (e.g.
ErrServiceUninitialized indicates that a service (e.g.

# Structs

LocationPath stores a path consisting of a project and zone/region.
MessageMetadata holds properties of a message published to the Pub/Sub Lite service.
PublishSettings control the batching of published messages.
ReceivedMessage stores a received Pub/Sub message and AckConsumer for acknowledging the message.
ReceiveSettings control the receiving of messages.
ReservationPath stores the full path of a Pub/Sub Lite reservation.
SubscriptionPath stores the full path of a Pub/Sub Lite subscription.
TopicPath stores the full path of a Pub/Sub Lite topic.

# Interfaces

AckConsumer is the interface exported from this package for acking messages.
Publisher is the client interface exported from this package for publishing messages.
Subscriber is the client interface exported from this package for receiving messages.

# Type aliases

FrameworkType is the user-facing API for Cloud Pub/Sub Lite.
MessageReceiverFunc receives a Pub/Sub message from a topic partition.
PartitionSet is a set of partition numbers.
PublishResultFunc receives the result of a publish.
ReassignmentHandlerFunc receives a partition assignment change.