Documentation
¶
Overview ¶
package gocloud provides implementations of the whosonfirst/go-webhookd 'Dispatcher' interfaces for GoCloud resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlobDispatcher ¶
NewBlobDispatcher returns a new `BlobDispatcher` instance configured by 'uri' which is expected to be a valid and registered `gocloud.dev/blob.Bucket` URI. The following extra parameters are supported (and removed before the underelying bucket instance is created): - `?dispatch_prefix=_ts_` If present a unix timestamp will be prepended to the final filename.
Types ¶
type BlobDispatcher ¶
type BlobDispatcher struct {
webhookd.WebhookDispatcher
// contains filtered or unexported fields
}
BlobDispatcher implements the `webhookd.WebhookDispatcher` interface for dispatching messages to a gocloud.dev/blob.Bucket instance. Messages are written to the underlying bucket instance with a filename derived from the SHA-256 hash of the message body.
func (*BlobDispatcher) Dispatch ¶
func (d *BlobDispatcher) Dispatch(ctx context.Context, body []byte) *webhookd.WebhookError
Dispatch will write 'body' to the underlying `gocloud.dev/blob.Bucket` instance contained by 'd'. Filenames are derived from the SHA-256 hash for 'body'.