serverless

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package serverless provides a portable serverless functions API with cross-cutting concerns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Serverless)

func WithErrorInjection

func WithErrorInjection(i *inject.Injector) Option

func WithLatency

func WithLatency(d time.Duration) Option

func WithMetrics

func WithMetrics(m *metrics.Collector) Option

func WithRateLimiter

func WithRateLimiter(l *ratelimit.Limiter) Option

func WithRecorder

func WithRecorder(r *recorder.Recorder) Option

type Serverless

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

Serverless is the portable serverless type wrapping a driver.

func NewServerless

func NewServerless(d driver.Serverless, opts ...Option) *Serverless

NewServerless creates a new portable Serverless.

func (*Serverless) CreateAlias added in v1.2.0

func (s *Serverless) CreateAlias(ctx context.Context, config driver.AliasConfig) (*driver.Alias, error)

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

func (*Serverless) CreateEventSourceMapping added in v1.4.0

func (s *Serverless) CreateEventSourceMapping(
	ctx context.Context, config driver.EventSourceMappingConfig,
) (*driver.EventSourceMappingInfo, error)

CreateEventSourceMapping creates a new event source mapping.

func (*Serverless) CreateFunction

func (s *Serverless) CreateFunction(ctx context.Context, config driver.FunctionConfig) (*driver.FunctionInfo, error)

func (*Serverless) DeleteAlias added in v1.2.0

func (s *Serverless) DeleteAlias(ctx context.Context, functionName, aliasName string) error

DeleteAlias removes an alias from a function.

func (*Serverless) DeleteEventSourceMapping added in v1.4.0

func (s *Serverless) DeleteEventSourceMapping(ctx context.Context, uuid string) error

DeleteEventSourceMapping deletes an event source mapping by UUID.

func (*Serverless) DeleteFunction

func (s *Serverless) DeleteFunction(ctx context.Context, name string) error

func (*Serverless) DeleteFunctionConcurrency added in v1.2.0

func (s *Serverless) DeleteFunctionConcurrency(ctx context.Context, functionName string) error

DeleteFunctionConcurrency removes the concurrency configuration for a function.

func (*Serverless) DeleteLayerVersion added in v1.2.0

func (s *Serverless) DeleteLayerVersion(ctx context.Context, name string, version int) error

DeleteLayerVersion removes a specific version of a layer.

func (*Serverless) GetAlias added in v1.2.0

func (s *Serverless) GetAlias(ctx context.Context, functionName, aliasName string) (*driver.Alias, error)

GetAlias retrieves a specific alias for a function.

func (*Serverless) GetEventSourceMapping added in v1.4.0

func (s *Serverless) GetEventSourceMapping(
	ctx context.Context, uuid string,
) (*driver.EventSourceMappingInfo, error)

GetEventSourceMapping retrieves an event source mapping by UUID.

func (*Serverless) GetFunction

func (s *Serverless) GetFunction(ctx context.Context, name string) (*driver.FunctionInfo, error)

func (*Serverless) GetFunctionConcurrency added in v1.2.0

func (s *Serverless) GetFunctionConcurrency(
	ctx context.Context, functionName string,
) (*driver.ConcurrencyConfig, error)

GetFunctionConcurrency retrieves the concurrency configuration for a function.

func (*Serverless) GetLayerVersion added in v1.2.0

func (s *Serverless) GetLayerVersion(ctx context.Context, name string, version int) (*driver.LayerVersion, error)

GetLayerVersion retrieves a specific version of a layer.

func (*Serverless) Invoke

func (*Serverless) ListAliases added in v1.2.0

func (s *Serverless) ListAliases(ctx context.Context, functionName string) ([]driver.Alias, error)

ListAliases returns all aliases for a function.

func (*Serverless) ListEventSourceMappings added in v1.4.0

func (s *Serverless) ListEventSourceMappings(
	ctx context.Context, functionName string,
) ([]driver.EventSourceMappingInfo, error)

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

func (*Serverless) ListFunctions

func (s *Serverless) ListFunctions(ctx context.Context) ([]driver.FunctionInfo, error)

func (*Serverless) ListLayerVersions added in v1.2.0

func (s *Serverless) ListLayerVersions(ctx context.Context, name string) ([]driver.LayerVersion, error)

ListLayerVersions returns all versions of a layer.

func (*Serverless) ListLayers added in v1.2.0

func (s *Serverless) ListLayers(ctx context.Context) ([]driver.LayerVersion, error)

ListLayers returns the latest version of each layer.

func (*Serverless) ListVersions added in v1.2.0

func (s *Serverless) ListVersions(ctx context.Context, functionName string) ([]driver.FunctionVersion, error)

ListVersions returns all published versions for a function.

func (*Serverless) PublishLayerVersion added in v1.2.0

func (s *Serverless) PublishLayerVersion(ctx context.Context, config driver.LayerConfig) (*driver.LayerVersion, error)

PublishLayerVersion publishes a new version of a layer.

func (*Serverless) PublishVersion added in v1.2.0

func (s *Serverless) PublishVersion(ctx context.Context, functionName, description string) (*driver.FunctionVersion, error)

PublishVersion publishes a new immutable version of a function.

func (*Serverless) PutFunctionConcurrency added in v1.2.0

func (s *Serverless) PutFunctionConcurrency(ctx context.Context, config driver.ConcurrencyConfig) error

PutFunctionConcurrency sets reserved concurrency for a function.

func (*Serverless) RegisterHandler

func (s *Serverless) RegisterHandler(name string, handler driver.HandlerFunc)

func (*Serverless) UpdateAlias added in v1.2.0

func (s *Serverless) UpdateAlias(ctx context.Context, config driver.AliasConfig) (*driver.Alias, error)

UpdateAlias updates an existing alias configuration.

func (*Serverless) UpdateEventSourceMapping added in v1.4.0

func (s *Serverless) UpdateEventSourceMapping(
	ctx context.Context, uuid string, config driver.EventSourceMappingConfig,
) (*driver.EventSourceMappingInfo, error)

UpdateEventSourceMapping updates an existing event source mapping.

func (*Serverless) UpdateFunction

func (s *Serverless) UpdateFunction(ctx context.Context, name string, config driver.FunctionConfig) (*driver.FunctionInfo, error)

Directories

Path Synopsis
Package driver defines the interface for serverless function service implementations.
Package driver defines the interface for serverless function service implementations.

Jump to

Keyboard shortcuts

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