Documentation
¶
Index ¶
- Variables
- func New(options ...FunctionAppOption) *functionApp
- func NewFunctionApp(options ...FunctionAppOption) *functionApp
- type Context
- type EventGridTriggerFunc
- type FunctionAppOption
- func WithClient(name string, client any) FunctionAppOption
- func WithDisableLogging() FunctionAppOption
- func WithIdleTimeout(d time.Duration) FunctionAppOption
- func WithLogger(log Logger) FunctionAppOption
- func WithReadTimeout(d time.Duration) FunctionAppOption
- func WithService(name string, service any) FunctionAppOption
- func WithShutdownFunc(fn func() error) FunctionAppOption
- func WithWriteTimeout(d time.Duration) FunctionAppOption
- type FunctionOption
- func EventGridTrigger(name string, fn EventGridTriggerFunc, options ...trigger.EventGridOption) FunctionOption
- func GenericTrigger(name string, fn GenericTriggerFunc, options ...trigger.GenericOption) FunctionOption
- func HTTPTrigger(fn HTTPTriggerFunc, options ...trigger.HTTPOption) FunctionOption
- func QueueTrigger(name string, fn QueueTriggerFunc, options ...trigger.QueueOption) FunctionOption
- func ServiceBusTrigger(name string, fn ServiceBusTriggerFunc, options ...trigger.ServiceBusOption) FunctionOption
- func TimerTrigger(fn TimerTriggerFunc, options ...trigger.TimerOption) FunctionOption
- func WithOutput(output outputable) FunctionOption
- type GenericTriggerFunc
- type HTTPTriggerFunc
- type InvocationLogger
- type Logger
- type QueueTriggerFunc
- type ServiceBusTriggerFunc
- type TimerTriggerFunc
Constants ¶
This section is empty.
Variables ¶
var ErrNoFunction = errors.New("at least one function must be set")
ErrNoFunction is returned when no function has been set to the FunctionApp.
Functions ¶
func New ¶ added in v0.17.0
func New(options ...FunctionAppOption) *functionApp
New creates and configures a FunctionApp.
func NewFunctionApp ¶
func NewFunctionApp(options ...FunctionAppOption) *functionApp
NewFunctionApp creates and configures a FunctionApp.
Types ¶
type Context ¶
type Context struct {
context.Context
// Outputs contains output bindings.
Outputs *outputs
// 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.
type EventGridTriggerFunc ¶ added in v0.14.0
EventGridTriggerFunc represents an Event Grid trigger function to be executed by the function app.
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 WithDisableLogging ¶ added in v0.18.0
func WithDisableLogging() FunctionAppOption
WithDisableLogging disables logging for the FunctionApp.
func WithIdleTimeout ¶ added in v0.21.0
func WithIdleTimeout(d time.Duration) FunctionAppOption
WithIdleTimeout sets the idle timeout for the FunctionApp HTTP server.
func WithLogger ¶
func WithLogger(log Logger) FunctionAppOption
WithLogger sets the provided Logger to the FunctionApp.
func WithReadTimeout ¶ added in v0.21.0
func WithReadTimeout(d time.Duration) FunctionAppOption
WithReadTimeout sets the read timeout for the FunctionApp HTTP server.
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.
func WithShutdownFunc ¶ added in v0.22.0
func WithShutdownFunc(fn func() error) FunctionAppOption
WithShutdownFunc sets a function that will be called when the FunctionApp is stopped. This can be used to perform cleanup operations or to gracefully shutdown dependencies. Can be used multiple times to add multiple shutdown functions.
func WithWriteTimeout ¶ added in v0.21.0
func WithWriteTimeout(d time.Duration) FunctionAppOption
WithWriteTimeout sets the write timeout for the FunctionApp HTTP server.
type FunctionOption ¶
type FunctionOption func(f *function)
FunctionOption sets options to the function.
func EventGridTrigger ¶ added in v0.14.0
func EventGridTrigger(name string, fn EventGridTriggerFunc, options ...trigger.EventGridOption) FunctionOption
EventGridTrigger takes the provided name and function and sets it as the function to be run by the trigger.
func GenericTrigger ¶ added in v0.15.0
func GenericTrigger(name string, fn GenericTriggerFunc, options ...trigger.GenericOption) FunctionOption
GenericTrigger takes the provided name and function and sets it as the function to be run by the trigger.
func HTTPTrigger ¶
func HTTPTrigger(fn HTTPTriggerFunc, options ...trigger.HTTPOption) 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, options ...trigger.QueueOption) 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, options ...trigger.ServiceBusOption) 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, options ...trigger.TimerOption) FunctionOption
TimerTrigger takes the provided function and sets it as the function to be run by the trigger.
func WithOutput ¶ added in v0.17.0
func WithOutput(output outputable) FunctionOption
WithOutput sets the provided output binding to the function.
type GenericTriggerFunc ¶ added in v0.15.0
GenericTriggerFunc represents a generic function to be executed by the function app.
type HTTPTriggerFunc ¶
HTTPTriggerFunc represents an HTTP trigger function to be executed by the function app.
type InvocationLogger ¶ added in v0.20.0
InvocationLogger is the interface that wraps around the methods Debug, Error, Info, Warn and Write. It is used to log to the function host.
type Logger ¶ added in v0.16.0
type Logger interface {
Debug(msg string, args ...any)
Error(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
}
Logger is the interface that wraps around methods Debug, Error, Info and Warn. It is used to log to stdout and stderr.
type QueueTriggerFunc ¶ added in v0.7.0
QueueTriggerFunc represents a Queue Storage trigger function to be exexuted by the function app.
type ServiceBusTriggerFunc ¶ added in v0.7.0
type ServiceBusTriggerFunc func(ctx *Context, trigger *trigger.ServiceBus) error
ServiceBusTriggerFunc represents a Service Bus trigger function to be exexuted by the function app.