Documentation
¶
Index ¶
- type Pipeline
- type QueueMessage
- type Webhook
- func (r *Webhook) Bytes() []byte
- func (r *Webhook) MarshalBinary() ([]byte, error)
- func (r *Webhook) MarshalHeaders(headers http.Header) ([]byte, error)
- func (r *Webhook) MarshalQueryParams(v urlpkg.Values) ([]byte, error)
- func (r *Webhook) MarshalUrl(u urlpkg.URL) ([]byte, error)
- func (r *Webhook) SetHeaders(headers http.Header) error
- func (r *Webhook) SetQueryParams(v urlpkg.Values) error
- func (r *Webhook) SetUrl(u urlpkg.URL) error
- func (r *Webhook) UnmarshalBinary(data []byte) error
- func (r *Webhook) UnmarshalHeaders() (http.Header, error)
- func (r *Webhook) UnmarshalQueryParams() (urlpkg.Values, error)
- func (r *Webhook) UnmarshalUrl() (urlpkg.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct {
// The name of the pipeline.
Name string
}
func (*Pipeline) MarshalBinary ¶
func (*Pipeline) UnmarshalBinary ¶
type QueueMessage ¶
type QueueMessage struct {
// UniqueId is a unique id to identify this message. It may be used for
// de-duplication by the stream processing.
UniqueId ksuid.KSUID
// Pipelines are the named pipelines to place the message on. You can think
// of a pipeline as a series of unordered named queues.
//
// If there are multiple Pipelines set, then the message will be pushed
// to each one. Pushing to Pipelines is atomic from the client, but not
// guaranteed by the hyperscalr ingress plane. Hyperscalr ingress place will
// attempt to push to the configured Pipelines optimistically on it's
// end. This is the same as if multiple calls by the client were made to
// single Pipelines.
Pipelines []Pipeline
// Payload message body of what you want pushed into the queue.
//
// It does have restrictions on size. The server is likely to reject
// QueueMessage with total size greater than 32 KB.
Payload []byte
// The destination where the payload will be sent.
WebhookDestination *Webhook
}
func QueueMessageFromNATS ¶
func QueueMessageFromNATS(msg *nats.Msg) QueueMessage
func (*QueueMessage) Bytes ¶
func (i *QueueMessage) Bytes() []byte
func (*QueueMessage) MarshalBinary ¶
func (i *QueueMessage) MarshalBinary() ([]byte, error)
func (*QueueMessage) NewReader ¶
func (i *QueueMessage) NewReader() io.Reader
func (*QueueMessage) UnmarshalBinary ¶
func (i *QueueMessage) UnmarshalBinary(data []byte) error
type Webhook ¶
type Webhook struct {
// The http request Method, i.e. GET, POST.
Method string
// Headers to be set in the http request.
// To understand how this is serialized, see:
// - https://golang.org/pkg/net/http/#Header.Write
// - https://golang.org/pkg/net/textproto/#Reader.ReadMIMEHeader
Headers []byte
// URL encoded query paramaters to be set in the http request.
// This is marshaled and unmarshaled using Encode and ParseQuery.
// - https://golang.org/pkg/net/url/#Values.Encode
// - https://golang.org/pkg/net/url/#ParseQuery
QueryParams string
// URL to send the request to. You may include query parameters in the Url.
// The QueryParams specified seperately will be appended to this Url before
// making the request.
//
// This is marshaled and unmarshaled using MarshalBinary and UnmarshalBinary.
// - https://golang.org/pkg/net/url/#Values
// - https://golang.org/pkg/net/url/#ParseRequestURI
// - https://golang.org/pkg/net/url/#URL.MarshalBinary
// - https://golang.org/pkg/net/url/#URL.UnmarshalBinary
Url []byte
}
func NewWebhook ¶
func NewWebhook( method string, headers map[string][]string, queryParams urlpkg.Values, url string, ) (*Webhook, error)
NewWebhook is a conviencee factory for creating a Webhook. It performs validation, so if possible it's better to call this function once and re-use the resulting object.
func (*Webhook) MarshalBinary ¶
func (*Webhook) MarshalHeaders ¶
func (*Webhook) MarshalQueryParams ¶
func (*Webhook) UnmarshalBinary ¶
func (*Webhook) UnmarshalQueryParams ¶
Click to show internal directories.
Click to hide internal directories.