functions

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package functions provides an in-memory mock implementation of Azure Functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is an in-memory mock implementation of Azure Functions.

func New

func New(opts *config.Options) *Mock

New creates a new Azure Functions mock.

func (*Mock) CreateAlias added in v1.2.0

func (m *Mock) CreateAlias(_ context.Context, cfg driver.AliasConfig) (*driver.Alias, error)

CreateAlias creates a new deployment slot alias pointing to a specific function version.

func (*Mock) CreateEventSourceMapping added in v1.4.0

func (m *Mock) CreateEventSourceMapping(
	_ context.Context, cfg driver.EventSourceMappingConfig,
) (*driver.EventSourceMappingInfo, error)

CreateEventSourceMapping creates a new event source mapping.

func (*Mock) CreateFunction

func (m *Mock) CreateFunction(_ context.Context, cfg driver.FunctionConfig) (*driver.FunctionInfo, error)

CreateFunction creates a new Azure Function.

func (*Mock) DeleteAlias added in v1.2.0

func (m *Mock) DeleteAlias(_ context.Context, functionName, aliasName string) error

DeleteAlias removes a deployment slot alias from a function.

func (*Mock) DeleteEventSourceMapping added in v1.4.0

func (m *Mock) DeleteEventSourceMapping(_ context.Context, uuid string) error

DeleteEventSourceMapping deletes an event source mapping by UUID.

func (*Mock) DeleteFunction

func (m *Mock) DeleteFunction(_ context.Context, name string) error

DeleteFunction deletes an Azure Function by name.

func (*Mock) DeleteFunctionConcurrency added in v1.2.0

func (m *Mock) DeleteFunctionConcurrency(_ context.Context, functionName string) error

DeleteFunctionConcurrency removes the concurrency configuration for an Azure Function.

func (*Mock) DeleteLayerVersion added in v1.2.0

func (m *Mock) DeleteLayerVersion(_ context.Context, name string, version int) error

DeleteLayerVersion removes a specific version of a shared code extension.

func (*Mock) GetAlias added in v1.2.0

func (m *Mock) GetAlias(_ context.Context, functionName, aliasName string) (*driver.Alias, error)

GetAlias retrieves a specific deployment slot alias for a function.

func (*Mock) GetEventSourceMapping added in v1.4.0

func (m *Mock) GetEventSourceMapping(_ context.Context, uuid string) (*driver.EventSourceMappingInfo, error)

GetEventSourceMapping retrieves an event source mapping by UUID.

func (*Mock) GetFunction

func (m *Mock) GetFunction(_ context.Context, name string) (*driver.FunctionInfo, error)

GetFunction retrieves an Azure Function by name.

func (*Mock) GetFunctionConcurrency added in v1.2.0

func (m *Mock) GetFunctionConcurrency(_ context.Context, functionName string) (*driver.ConcurrencyConfig, error)

GetFunctionConcurrency retrieves the concurrency configuration for an Azure Function.

func (*Mock) GetLayerVersion added in v1.2.0

func (m *Mock) GetLayerVersion(_ context.Context, name string, version int) (*driver.LayerVersion, error)

GetLayerVersion retrieves a specific version of a shared code extension.

func (*Mock) Invoke

func (m *Mock) Invoke(ctx context.Context, input driver.InvokeInput) (*driver.InvokeOutput, error)

Invoke invokes an Azure Function with the given input.

func (*Mock) ListAliases added in v1.2.0

func (m *Mock) ListAliases(_ context.Context, functionName string) ([]driver.Alias, error)

ListAliases returns all deployment slot aliases for a function.

func (*Mock) ListEventSourceMappings added in v1.4.0

func (m *Mock) ListEventSourceMappings(_ context.Context, functionName string) ([]driver.EventSourceMappingInfo, error)

ListEventSourceMappings lists event source mappings, optionally filtered by function name.

func (*Mock) ListFunctions

func (m *Mock) ListFunctions(_ context.Context) ([]driver.FunctionInfo, error)

ListFunctions lists all Azure Functions.

func (*Mock) ListLayerVersions added in v1.2.0

func (m *Mock) ListLayerVersions(_ context.Context, name string) ([]driver.LayerVersion, error)

ListLayerVersions returns all versions of a shared code extension.

func (*Mock) ListLayers added in v1.2.0

func (m *Mock) ListLayers(_ context.Context) ([]driver.LayerVersion, error)

ListLayers returns the latest version of each shared code extension.

func (*Mock) ListVersions added in v1.2.0

func (m *Mock) ListVersions(_ context.Context, functionName string) ([]driver.FunctionVersion, error)

ListVersions returns all published versions (deployment slots) for a function.

func (*Mock) PublishLayerVersion added in v1.2.0

func (m *Mock) PublishLayerVersion(_ context.Context, cfg driver.LayerConfig) (*driver.LayerVersion, error)

PublishLayerVersion publishes a new version of a shared code extension.

func (*Mock) PublishVersion added in v1.2.0

func (m *Mock) PublishVersion(_ context.Context, functionName, description string) (*driver.FunctionVersion, error)

PublishVersion snapshots the current function state as an immutable deployment slot version.

func (*Mock) PutFunctionConcurrency added in v1.2.0

func (m *Mock) PutFunctionConcurrency(_ context.Context, cfg driver.ConcurrencyConfig) error

PutFunctionConcurrency sets reserved concurrency for an Azure Function.

func (*Mock) RegisterHandler

func (m *Mock) RegisterHandler(name string, handler driver.HandlerFunc)

RegisterHandler registers a handler function for an Azure Function by name.

func (*Mock) SetMonitoring added in v1.2.0

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring sets the monitoring backend for auto-metric generation.

func (*Mock) UpdateAlias added in v1.2.0

func (m *Mock) UpdateAlias(_ context.Context, cfg driver.AliasConfig) (*driver.Alias, error)

UpdateAlias updates an existing deployment slot alias.

func (*Mock) UpdateEventSourceMapping added in v1.4.0

func (m *Mock) UpdateEventSourceMapping(
	_ context.Context, uuid string, cfg driver.EventSourceMappingConfig,
) (*driver.EventSourceMappingInfo, error)

UpdateEventSourceMapping updates an existing event source mapping.

func (*Mock) UpdateFunction

func (m *Mock) UpdateFunction(_ context.Context, name string, cfg driver.FunctionConfig) (*driver.FunctionInfo, error)

UpdateFunction updates an existing Azure Function's configuration.

Jump to

Keyboard shortcuts

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