Documentation ¶
Index ¶
- type GCPPublisher
- func (p GCPPublisher) Publish(ctx context.Context, key string, msg proto.Message) error
- func (p GCPPublisher) PublishMulti(ctx context.Context, keys []string, msgs []proto.Message) error
- func (p GCPPublisher) PublishMultiRaw(ctx context.Context, _ []string, msgs [][]byte) error
- func (p GCPPublisher) PublishRaw(ctx context.Context, key string, msg []byte) error
- type Publisher
- func (p Publisher) Publish(ctx context.Context, key string, msg proto.Message) error
- func (p Publisher) PublishMulti(ctx context.Context, keys []string, msgs []proto.Message) error
- func (p Publisher) PublishMultiRaw(ctx context.Context, _ []string, msgs [][]byte) error
- func (p Publisher) PublishRaw(_ context.Context, _ string, payload []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCPPublisher ¶ added in v0.2.1
GCPPublisher publishes data in the same format as a GCP push-style payload.
func NewGCPStylePublisher ¶
func NewGCPStylePublisher(url string, client *http.Client) GCPPublisher
NewGCPStylePublisher will return a pubsub.Publisher that wraps the payload in a GCP pubsub.Message-like object that will make this publisher emulate Google's PubSub posting messages to a server. If no http.Client is provided, the default one has a 5 second timeout.
func (GCPPublisher) Publish ¶ added in v0.2.1
Publish will serialize the given message and pass it to PublishRaw.
func (GCPPublisher) PublishMulti ¶ added in v0.2.1
PublishMulti will serialize the given messages and pass them to PublishMultiRaw.
func (GCPPublisher) PublishMultiRaw ¶ added in v0.2.1
PublishMultiRaw will call PublishRaw for each message given.
func (GCPPublisher) PublishRaw ¶ added in v0.2.1
PublishRaw will wrap the given message in a struct similar to GCP's push-style PubSub subscriptions and then POST the message payload at the URL provided in the construct.
type Publisher ¶ added in v0.2.1
type Publisher struct {
// contains filtered or unexported fields
}
Publisher implements the pubsub.Publisher and MultiPublisher interfaces for use in a plain HTTP environment.
func NewPublisher ¶
NewPublisher will return a pubsub.Publisher that simply posts the payload to the given URL. If no http.Client is provided, the default one has a 5 second timeout.
func (Publisher) Publish ¶ added in v0.2.1
Publish will serialize the given message and pass it to PublishRaw.
func (Publisher) PublishMulti ¶ added in v0.2.1
PublishMulti will serialize the given messages and pass them to PublishMultiRaw.
func (Publisher) PublishMultiRaw ¶ added in v0.2.1
PublishMultiRaw will call PublishRaw for each message given.