Documentation ¶
Overview ¶
Package function implements function-level operations.
Index ¶
- Constants
- type Config
- type Function
- func (f *Function) Clean() error
- func (f *Function) Create(zip []byte) error
- func (f *Function) Delete() error
- func (f *Function) Deploy() error
- func (f *Function) DeployCode() error
- func (f *Function) DeployConfig() error
- func (f *Function) Dir() string
- func (f *Function) Info() (*lambda.GetFunctionOutput, error)
- func (f *Function) Invoke(event, context interface{}, kind InvocationType) (reply, logs io.Reader, err error)
- func (f *Function) Open() error
- func (f *Function) Rollback() error
- func (f *Function) RollbackVersion(version string) error
- func (f *Function) SetEnv(name, value string)
- func (f *Function) Update(zip []byte) error
- func (f *Function) Zip() (io.Reader, error)
- func (f *Function) ZipBytes() ([]byte, error)
- type InvocationType
- type InvokeError
Constants ¶
const ( RequestResponse InvocationType = "RequestResponse" Event = "Event" DryRun = "DryRun" )
Invocation types.
const CurrentAlias = "current"
Current alias name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `json:"name" validate:"nonzero"` Description string `json:"description"` Runtime string `json:"runtime" validate:"nonzero"` Memory int64 `json:"memory" validate:"nonzero"` Timeout int64 `json:"timeout" validate:"nonzero"` Role string `json:"role" validate:"nonzero"` }
Config for a Lambda function.
type Function ¶
type Function struct { Config Path string Service lambdaiface.LambdaAPI Log log.Interface // contains filtered or unexported fields }
Function represents a Lambda function, with configuration loaded from the "function.json" file on disk. Operations are performed against the function directory as the CWD, so os.Chdir() first.
func (*Function) DeployCode ¶ added in v0.2.0
DeployCode generates a zip and creates or updates the function.
func (*Function) DeployConfig ¶ added in v0.1.0
DeployConfig deploys changes to configuration.
func (*Function) Info ¶
func (f *Function) Info() (*lambda.GetFunctionOutput, error)
Info returns the function information.
func (*Function) Invoke ¶ added in v0.1.0
func (f *Function) Invoke(event, context interface{}, kind InvocationType) (reply, logs io.Reader, err error)
Invoke the remote Lambda function, returning the response and logs, if any.
func (*Function) RollbackVersion ¶ added in v0.3.0
RollbackVersion the function to the specified version.
type InvocationType ¶ added in v0.1.0
type InvocationType string
InvocationType determines how an invocation request is made.