Skip to content

Commit

Permalink
Add Annotations field to QueueRequest
Browse files Browse the repository at this point in the history
- Add an annotations field to pass additional meta-date to the consumers of
  queue requests.
- Add JSON attributes to struct.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Aug 25, 2023
1 parent b832d4d commit d24376c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions types/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,36 @@ import (
// Request for asynchronous processing
type QueueRequest struct {
// Header from HTTP request
Header http.Header
Header http.Header `json:"Header,omitempty"`

// Host from HTTP request
Host string
Host string `json:"Host,omitempty"`

// Body from HTTP request to use for invocation
Body []byte
Body []byte `json:"Body,omitempty"`

// Method from HTTP request
Method string
Method string `json:"Method"`

// Path from HTTP request
Path string
Path string `json:"Path,omitempty"`

// QueryString from HTTP request
QueryString string
QueryString string `json:"QueryString,omitempty"`

// Function name to invoke
Function string
Function string `json:"Function"`

// QueueName to publish the request to, leave blank
// for default.
QueueName string
QueueName string `json:"QueueName,omitempty"`

// Annotations defines a collection of meta-data that can be used by
// the queue worker when processing the queued request.
Annotations map[string]string `json:"Annotations,omitempty"`

// Used by queue worker to submit a result
CallbackURL *url.URL `json:"CallbackUrl"`
CallbackURL *url.URL `json:"CallbackUrl,omitempty"`
}

// RequestQueuer can public a request to be executed asynchronously
Expand Down

0 comments on commit d24376c

Please sign in to comment.