Documentation ¶
Index ¶
- Constants
- func ExtractBuildIDMap(ctx context.Context, msgs []*pubsubpb.ReceivedMessage) map[int64]*pubsubpb.ReceivedMessage
- func GetParentUID(msg *pubsubpb.ReceivedMessage) string
- func PublishBuild(ctx context.Context, attr map[string]string, conf *result_flow.PubSubConfig, ...) error
- func ShouldPollForCompletion(msg *pubsubpb.ReceivedMessage) bool
- type Client
Constants ¶
View Source
const ( // BuildIDKey is the key to store Build ID in message attributes. BuildIDKey = "build_id" // ParentUIDKey is the key to store parent UID. ParentUIDKey = "parent_uid" // ShouldPollForCompletionKey is the key to store flag should_poll_for_completion. ShouldPollForCompletionKey = "should_poll_for_completion" )
Variables ¶
This section is empty.
Functions ¶
func ExtractBuildIDMap ¶
func ExtractBuildIDMap(ctx context.Context, msgs []*pubsubpb.ReceivedMessage) map[int64]*pubsubpb.ReceivedMessage
ExtractBuildIDMap generates a map with key of Build ID and the value of parent UID.
func GetParentUID ¶
func GetParentUID(msg *pubsubpb.ReceivedMessage) string
GetParentUID reads the parent request UID from the message's attributes.
func PublishBuild ¶
func PublishBuild(ctx context.Context, attr map[string]string, conf *result_flow.PubSubConfig, opts ...option.ClientOption) error
PublishBuild publishes a Build to PubSub.
func ShouldPollForCompletion ¶
func ShouldPollForCompletion(msg *pubsubpb.ReceivedMessage) bool
ShouldPollForCompletion returns true if the message contains the attribute "should_poll_for_completion" and its value is boolean true represented by a string.
Types ¶
type Client ¶
type Client interface { PullMessages(context.Context) ([]*pubsubpb.ReceivedMessage, error) AckMessages(context.Context, []*pubsubpb.ReceivedMessage) error Close() error }
Client defines an interface used to interact with pubsub
func NewClient ¶
func NewClient(c context.Context, conf *result_flow.PubSubConfig, batchSize int32, opts ...option.ClientOption) (Client, error)
NewClient creates a messageClient for PubSub subscriber.
Click to show internal directories.
Click to hide internal directories.