Documentation ¶
Index ¶
- Variables
- type EventGrid
- type EventGridMetadata
- type EventGridOption
- type EventGridOptions
- type Generic
- type GenericOption
- type GenericOptions
- type HTTP
- type HTTPIdentity
- type HTTPIdentityClaims
- type HTTPMetadata
- type HTTPOption
- type HTTPOptions
- type Metadata
- type MetadataSys
- type Queue
- type QueueMetadata
- type QueueOption
- type QueueOptions
- type ServiceBus
- type ServiceBusMetadata
- type ServiceBusMetadataClient
- type ServiceBusOption
- type ServiceBusOptions
- type TimeISO8601
- type Timer
- type TimerOption
- type TimerOptions
- type TimerSchedule
- type TimerScheduleStatus
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHTTPInvalidContentType is returned when an invalid Content-Type provided. ErrHTTPInvalidContentType = errors.New("invalid Content-Type") // ErrHTTPInvalidBody is returned when the HTTP body is invalid. ErrHTTPInvalidBody = errors.New("invalid body") )
var ( // ErrTriggerNameIncorrect is returned when the provided trigger // name does not match the payload trigger name. ErrTriggerNameIncorrect = errors.New("trigger name incorrect") // ErrTriggerPayloadMalformed is returned if there is an error // with the payload from the Function host. ErrTriggerPayloadMalformed = errors.New("trigger payload malformed") )
Functions ¶
This section is empty.
Types ¶
type EventGrid ¶
type EventGrid struct { Time time.Time Metadata EventGridMetadata ID string // Topic is the topic of the event. It is the same as the source // for Cloud Events. Topic string // Source is the source of the event. It is the same as the topic // for Event Grid events. Source string Subject string Type string Data any Schema eventgrid.Schema }
EventGrid represents an Event Grid trigger. It handles both Cloud Events and Event Grid events. CloudEvents contains source where as an Event Grid event contains topic.
func NewEventGrid ¶
NewEventGrid creates and returns an Event Grid trigger from the provided *http.Request.
type EventGridMetadata ¶
EventGridMetadata represents the metadata for an Event Grid trigger.
type EventGridOption ¶
type EventGridOption func(o *EventGridOptions)
EventGridOption is a function that sets options on an Event Grid trigger.
type EventGridOptions ¶
type EventGridOptions struct{}
EventGridOptions contains options for an Event Grid trigger.
type Generic ¶
Generic represents a generic Function App trigger. With custom handlers many triggers that are not HTTP triggers share the same data structure.
func NewGeneric ¶
NewGeneric creates an returns a Generic trigger from the provided *http.Request.
type GenericOption ¶
type GenericOption func(o *GenericOptions)
GenericOption is a function that sets options on a Generic trigger.
type GenericOptions ¶
type GenericOptions struct{}
GenericOptions contains options for a Generic trigger.
type HTTP ¶
type HTTP struct { Headers http.Header Params map[string]string Query map[string]string URL string `json:"Url"` Method string Body data.Raw Metadata HTTPMetadata Identities []HTTPIdentity }
HTTP represents an HTTP trigger.
func NewHTTP ¶
func NewHTTP(r *http.Request, options ...HTTPOption) (*HTTP, error)
NewHTTP creates and returns an HTTP trigger from the provided *http.Request. By default it will use the name "req" for the trigger. This can be overridden with providing a name in the options.
func (HTTP) Form ¶
Form parses the HTTP trigger for form data sent with Content-Type application/x-www-form-urlencoded and returns it as url.Values.
func (HTTP) MultipartForm ¶
MultipartForm parses the HTTP trigger for multipart form data and returns the resulting *multipart.Form. The whole request body is parsed and up to a total of maxMemory bytes of its file parts are stored in memory, with the remainder stored on disk in temporary files. If 0 or less is provided it will default to 32 MB.
type HTTPIdentity ¶
type HTTPIdentity struct { Actor any BootstrapContext any Label any Name any AuthenticationType string NameClaimType string RoleClaimType string Claims []HTTPIdentityClaims IsAuthenticated bool }
HTTPIdentity represent a part of the Identities field of the incoming trigger request.
type HTTPIdentityClaims ¶
type HTTPIdentityClaims struct { Properties map[string]string Issuer string OriginalIssuer string Type string Value string ValueType string }
HTTPIdentityClaims represent the claims of an HTTPIdentity.
type HTTPMetadata ¶
type HTTPMetadata struct { Headers map[string]string Params map[string]string Query map[string]string Metadata }
HTTPMetadata represents the metadata for an HTTP trigger.
type HTTPOption ¶
type HTTPOption func(o *HTTPOptions)
HTTPOption is a function that sets options on an HTTP trigger.
type HTTPOptions ¶
type HTTPOptions struct {
Name string
}
HTTPOptions contains options for an HTTP trigger.
type Metadata ¶
type Metadata struct {
Sys MetadataSys `json:"sys"`
}
Metadata represents the metadata of the incoming trigger request.
type MetadataSys ¶
MetadataSys contains the sys fields of the incoming trigger request.
type Queue ¶
type Queue struct { Metadata QueueMetadata Data data.Raw }
Queue represents a Queue Storage trigger.
type QueueMetadata ¶
type QueueMetadata struct { DequeueCount string ID string PopReceipt string ExpirationTime time.Time InsertionTime time.Time NextVisibleTime time.Time Metadata }
QueueMetadata represents the metadata for a Queue Storage trigger.
type QueueOption ¶
type QueueOption func(o *QueueOptions)
QueueOption is a function that sets options on a Queue Storage trigger.
type QueueOptions ¶
type QueueOptions struct{}
QueueOptions contains options for a Queue Storage trigger.
type ServiceBus ¶
type ServiceBus struct { Data data.Raw Metadata ServiceBusMetadata }
ServiceBus represents a Service Bus trigger. It supports both queues and topics with subscriptions.
func NewServiceBus ¶
func NewServiceBus(r *http.Request, name string, options ...ServiceBusOption) (*ServiceBus, error)
NewServiceBus creates and returns a new Service Bus trigger from the provided *http.Request.
func (ServiceBus) Parse ¶
func (t ServiceBus) Parse(v any) error
Parse the data for the Service Bus trigger into the provided value.
type ServiceBusMetadata ¶
type ServiceBusMetadata struct { MessageReceiver map[string]any MessageSession map[string]any MessageActions map[string]any SessionActions map[string]any ReceiveActions map[string]any ApplicationProperties map[string]any UserProperties map[string]any DeliveryCount string LockToken string MessageID string ContentType string SequenceNumber string Metadata ExpiresAtUTC TimeISO8601 `json:"ExpiresAtUtc"` ExpiresAt TimeISO8601 EnqueuedTimeUTC TimeISO8601 `json:"EnqueuedTimeUtc"` EnqueuedTime TimeISO8601 Client ServiceBusMetadataClient }
ServiceBusMetadata represents the metadata for a Service Bus trigger.
type ServiceBusMetadataClient ¶
type ServiceBusMetadataClient struct { FullyQualifiedNamespace string Identifier string TransportType int IsClosed bool }
ServiceBusMetadataClient represents client of the service bus trigger metadata.
type ServiceBusOption ¶
type ServiceBusOption func(o *ServiceBusOptions)
ServiceBusOption is a function that sets options on a Service Bus trigger.
type ServiceBusOptions ¶
type ServiceBusOptions struct{}
ServiceBusOptions contains options for a Service Bus trigger.
type TimeISO8601 ¶
TimeISO8601 is a wrapper around time.Time that supports JSON marshalling/unmarshalling with format ISO8601 and ISO8601 with a provided timezone.
func (TimeISO8601) MarshalJSON ¶
func (t TimeISO8601) MarshalJSON() ([]byte, error)
MarshalJSON marshals a TimeISO8601 into a JSON time string.
func (*TimeISO8601) UnmarshalJSON ¶
func (t *TimeISO8601) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a JSON time string into a TimeISO8601. It supports with and without timezone.
type Timer ¶
type Timer struct { ScheduleStatus TimerScheduleStatus Metadata Metadata Schedule TimerSchedule IsPastDue bool }
Timer represent a Timer trigger.
type TimerOption ¶
type TimerOption func(o *TimerOptions)
TimerOption is a function that sets options on a Timer trigger.
type TimerOptions ¶
type TimerOptions struct {
Name string
}
TimerOptions contains options for a Timer trigger.
type TimerSchedule ¶
type TimerSchedule struct {
AdjustForDST bool
}
TimerSchedule represents the Schedule field from the incoming request.