bindings

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generic added in v0.15.0

type Generic struct {
	// contains filtered or unexported fields
}

Generic represents a generic output binding. With custom handlers all bindings that are not HTTP output bindings share the same data structure.

func NewGeneric added in v0.15.0

func NewGeneric(name string, options ...GenericOption) *Generic

NewGeneric creates a new generic output binding.

func (Generic) Data added in v0.15.0

func (b Generic) Data() data.Raw

Data returns the data of the binding.

func (Generic) Name added in v0.15.0

func (b Generic) Name() string

Name returns the name of the binding.

func (*Generic) Write added in v0.15.0

func (b *Generic) Write(d []byte) (int, error)

Write data to the binding.

type GenericOption added in v0.15.0

type GenericOption func(o *GenericOptions)

GenericOption is a function that sets options on a Generic output binding

type GenericOptions added in v0.15.0

type GenericOptions struct {
	// Name sets the name of the binding.
	Name string
	// Data sets the data of the binding.
	Data data.Raw
}

GenericOptions contains options for a Generic output binding.

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

HTTP represents an HTTP output binding.

func NewHTTP

func NewHTTP(options ...HTTPOption) *HTTP

NewHTTP creates a new HTTP output binding.

func (HTTP) Data added in v0.9.0

func (b HTTP) Data() data.Raw

Data returns the data of the binding.

func (*HTTP) Header

func (b *HTTP) Header() http.Header

Header returns the header(s) of the HTTP binding.

func (HTTP) MarshalJSON added in v0.11.0

func (b HTTP) MarshalJSON() ([]byte, error)

MarshalJSON implements custom marshaling to create the required JSON structure as expected by the function host.

func (HTTP) Name

func (b HTTP) Name() string

Name returns the name of the binding. In case of an HTTP binding it is always "res".

func (*HTTP) Write

func (b *HTTP) Write(d []byte) (int, error)

Write the provided data to the body of the HTTP bindings.

func (*HTTP) WriteHeader

func (b *HTTP) WriteHeader(statusCode int)

WriteHeader sets the response header with the provided status code.

func (*HTTP) WriteResponse added in v0.2.0

func (b *HTTP) WriteResponse(statusCode int, body []byte, options ...HTTPOption)

WriteResponse writes the provided status code, body and options to the HTTP binding. Supports option WithHeader.

type HTTPOption added in v0.12.0

type HTTPOption func(o *HTTPOptions)

HTTPOption is a function that sets options on an HTTP output binding.

func WithHeader added in v0.2.0

func WithHeader(header http.Header) HTTPOption

WithHeader adds the provided header to a HTTP binding.

type HTTPOptions added in v0.12.0

type HTTPOptions struct {
	// Header sets the body of the binding.
	Header http.Header
	// Name sets the name of the binding.
	Name string
	// Body sets the body of the binding.
	Body data.Raw
	// StatusCode sets the status code of the binding.
	StatusCode int
}

HTTPOptions contains options for an HTTP output binding.

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue represents a Queue Storage output binding.

func NewQueue

func NewQueue(name string, options ...QueueOption) *Queue

NewQueue creates a new queue storage output binding.

func (Queue) Data added in v0.9.0

func (b Queue) Data() data.Raw

Data returns the data of the binding.

func (Queue) Name added in v0.7.0

func (b Queue) Name() string

Name returns the name of the binding.

func (*Queue) Write added in v0.7.0

func (b *Queue) Write(d []byte) (int, error)

Write data to the binding.

type QueueOption added in v0.12.0

type QueueOption func(o *QueueOptions)

QueueOption is a function that sets options on a Queue Storage output binding.

type QueueOptions added in v0.12.0

type QueueOptions struct {
	// Name sets the name of the binding.
	Name string
	// Data sets the data of the binding.
	Data data.Raw
}

QueueOptions contains options for a Queue Storage output binding.

type ServiceBus added in v0.7.0

type ServiceBus struct {
	// contains filtered or unexported fields
}

ServiceBus represents a service bus output binding.

func NewServiceBus added in v0.7.0

func NewServiceBus(name string, options ...ServiceBusOption) *ServiceBus

NewServiceBus creates a new service bus output binding.

func (ServiceBus) Data added in v0.9.0

func (b ServiceBus) Data() data.Raw

Data returns the data of the binding.

func (ServiceBus) Name added in v0.7.0

func (b ServiceBus) Name() string

Name returns the name of the binding.

func (*ServiceBus) Write added in v0.7.0

func (b *ServiceBus) Write(d []byte) (int, error)

Write data to the binding.

type ServiceBusOption added in v0.12.0

type ServiceBusOption func(o *ServiceBusOptions)

ServiceBusOption is a function that sets options on a ServiceBus output binding.

type ServiceBusOptions added in v0.12.0

type ServiceBusOptions struct {
	// Name sets the name of the binding.
	Name string
	// Data sets the data of the binding.
	Data data.Raw
}

ServiceBusOptions contains options for a ServiceBus output binding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL