Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPPublisher

type GCPPublisher struct {
	pubsub.Publisher
}

    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

      func (p GCPPublisher) Publish(ctx context.Context, key string, msg proto.Message) error

        Publish will serialize the given message and pass it to PublishRaw.

        func (GCPPublisher) PublishMulti

        func (p GCPPublisher) PublishMulti(ctx context.Context, keys []string, msgs []proto.Message) error

          PublishMulti will serialize the given messages and pass them to PublishMultiRaw.

          func (GCPPublisher) PublishMultiRaw

          func (p GCPPublisher) PublishMultiRaw(ctx context.Context, _ []string, msgs [][]byte) error

            PublishMultiRaw will call PublishRaw for each message given.

            func (GCPPublisher) PublishRaw

            func (p GCPPublisher) PublishRaw(ctx context.Context, key string, msg []byte) error

              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

              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

                func NewPublisher(url string, client *http.Client) Publisher

                  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

                  func (p Publisher) Publish(ctx context.Context, key string, msg proto.Message) error

                    Publish will serialize the given message and pass it to PublishRaw.

                    func (Publisher) PublishMulti

                    func (p Publisher) PublishMulti(ctx context.Context, keys []string, msgs []proto.Message) error

                      PublishMulti will serialize the given messages and pass them to PublishMultiRaw.

                      func (Publisher) PublishMultiRaw

                      func (p Publisher) PublishMultiRaw(ctx context.Context, _ []string, msgs [][]byte) error

                        PublishMultiRaw will call PublishRaw for each message given.

                        func (Publisher) PublishRaw

                        func (p Publisher) PublishRaw(_ context.Context, _ string, payload []byte) error

                          PublishRaw will POST the given message payload at the URL provided in the Publisher construct.

                          Source Files