Documentation
¶
Overview ¶
Package driver defines the interface for serverless function service implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FunctionConfig ¶
type FunctionConfig struct {
Name string
Runtime string
Handler string
Memory int // MB
Timeout int // seconds
Environment map[string]string
Tags map[string]string
}
FunctionConfig describes a serverless function to create.
type FunctionInfo ¶
type FunctionInfo struct {
Name string
ARN string
Runtime string
Handler string
Memory int
Timeout int
State string
Environment map[string]string
Tags map[string]string
LastModified string
}
FunctionInfo describes a serverless function.
type HandlerFunc ¶
HandlerFunc is a function handler that processes invocations.
type InvokeInput ¶
type InvokeInput struct {
FunctionName string
Payload []byte
InvokeType string // "RequestResponse" or "Event"
}
InvokeInput configures a function invocation.
type InvokeOutput ¶
InvokeOutput is the result of a function invocation.
type Serverless ¶
type Serverless interface {
CreateFunction(ctx context.Context, config FunctionConfig) (*FunctionInfo, error)
DeleteFunction(ctx context.Context, name string) error
GetFunction(ctx context.Context, name string) (*FunctionInfo, error)
ListFunctions(ctx context.Context) ([]FunctionInfo, error)
UpdateFunction(ctx context.Context, name string, config FunctionConfig) (*FunctionInfo, error)
Invoke(ctx context.Context, input InvokeInput) (*InvokeOutput, error)
RegisterHandler(name string, handler HandlerFunc)
}
Serverless is the interface that serverless provider implementations must satisfy.
Click to show internal directories.
Click to hide internal directories.