Documentation ¶
Index ¶
- Variables
- type Context
- type FunctionApp
- type FunctionAppOption
- type FunctionOption
- func Binding(binding bindings.Bindable) FunctionOption
- func HTTPTrigger(fn HTTPTriggerFunc) FunctionOption
- func QueueTrigger(name string, fn QueueTriggerFunc) FunctionOption
- func ServiceBusTrigger(name string, fn ServiceBusTriggerFunc) FunctionOption
- func TimerTrigger(fn TimerTriggerFunc) FunctionOption
- func Trigger(name string, fn TriggerFunc) FunctionOption
- type HTTPTriggerFunc
- type QueueTriggerFunc
- type ServiceBusTriggerFunc
- type TimerTriggerFunc
- type TriggerFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoFunction is returned when no function has been set to the // FunctionApp. ErrNoFunction = errors.New("at least one function must be set") // ErrInvalidTrigger is returned when an invalid trigger has been // provided. ErrInvalidTrigger = errors.New("invalid trigger") )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { // Output contains bindings. Output bindings.Output // contains filtered or unexported fields }
Context represents the function context and contains output, bindings, services and clients.
func (*Context) Clients ¶
func (c *Context) Clients() clients
Clients returns the clients set in the Context.
func (Context) Log ¶ added in v0.2.0
func (c Context) Log() logger
Log returns the logger of the Context.
func (*Context) Services ¶
func (c *Context) Services() services
Services returns the services set in the Context.
type FunctionApp ¶
type FunctionApp struct {
// contains filtered or unexported fields
}
FunctionApp represents a Function App with its configuration and functions.
func NewFunctionApp ¶
func NewFunctionApp(options ...FunctionAppOption) *FunctionApp
NewFunction app creates and configures a FunctionApp.
func (*FunctionApp) AddFunction ¶
func (a *FunctionApp) AddFunction(name string, options ...FunctionOption)
AddFunction adds a function to the FunctionApp.
type FunctionAppOption ¶
type FunctionAppOption func(*FunctionApp)
FunctionAppOption is a function that sets options to a FunctionApp.
func WithClient ¶
func WithClient(name string, client any) FunctionAppOption
WithClient sets the provided client to the FunctionApp. Can be called multiple times. If a client with the same name has been set it will be overwritten.
func WithLogger ¶
func WithLogger(log logger) FunctionAppOption
WithLogger sets the provided logger to the FunctionApp. The logger must satisfy the logger interface.
func WithService ¶
func WithService(name string, service any) FunctionAppOption
WithService sets the provided service to the FunctionApp. Can be called multiple times. If a service with the same name has been set it will be overwritten.
type FunctionOption ¶
type FunctionOption func(f *function)
FunctionOption sets options to the function.
func Binding ¶
func Binding(binding bindings.Bindable) FunctionOption
Binding sets the provided binding to the function.
func HTTPTrigger ¶
func HTTPTrigger(fn HTTPTriggerFunc) FunctionOption
HTTPTrigger takes the provided function and sets it as the function to be run by the trigger.
func QueueTrigger ¶
func QueueTrigger(name string, fn QueueTriggerFunc) FunctionOption
QueueTrigger takes the provided name and function and sets it as the function to be run by the trigger.
func ServiceBusTrigger ¶ added in v0.7.0
func ServiceBusTrigger(name string, fn ServiceBusTriggerFunc) FunctionOption
ServiceBusTrigger takes the provided name and function and sets it as the function to be run by the trigger.
func TimerTrigger ¶
func TimerTrigger(fn TimerTriggerFunc) FunctionOption
TimerTrigger takes the provided function and sets it as the function to be run by the trigger.
func Trigger ¶
func Trigger(name string, fn TriggerFunc) FunctionOption
Trigger takes the provided name and function and sets it as the function to be run by the trigger.
type HTTPTriggerFunc ¶
HTTPTriggerFunc represents an HTTP based function to be executed by the function app.
type QueueTriggerFunc ¶ added in v0.7.0
QueueTriggerFunc represents a Queue Storage based function to be exexuted by the function app.
type ServiceBusTriggerFunc ¶ added in v0.7.0
type ServiceBusTriggerFunc func(ctx *Context, trigger *triggers.ServiceBus)
ServiceBusTriggerFunc represents a Service Bus based function to be exexuted by the function app.
type TimerTriggerFunc ¶ added in v0.2.0
TimerTriggerFunc represents a Timer based function tp be executed by the function app.
type TriggerFunc ¶
TriggerFunc represents a base function to be executed by the function app.