lambda

package
v0.0.0-...-d0813e5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package lambda provides a client for Amazon Lambda.

Index

Constants

View Source
const (
	ModeEvent = "event"
)

Possible values for Lambda.

View Source
const (
	RuntimeNodejs = "nodejs"
)

Possible values for Lambda.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEventSourceRequest

type AddEventSourceRequest struct {
	BatchSize    aws.IntegerValue  `json:"BatchSize,omitempty"`
	EventSource  aws.StringValue   `json:"EventSource"`
	FunctionName aws.StringValue   `json:"FunctionName"`
	Parameters   map[string]string `json:"Parameters,omitempty"`
	Role         aws.StringValue   `json:"Role"`
}

AddEventSourceRequest is undocumented.

type DeleteFunctionRequest

type DeleteFunctionRequest struct {
	FunctionName aws.StringValue `json:"-"`
}

DeleteFunctionRequest is undocumented.

type EventSourceConfiguration

type EventSourceConfiguration struct {
	BatchSize    aws.IntegerValue  `json:"BatchSize,omitempty"`
	EventSource  aws.StringValue   `json:"EventSource,omitempty"`
	FunctionName aws.StringValue   `json:"FunctionName,omitempty"`
	IsActive     aws.BooleanValue  `json:"IsActive,omitempty"`
	LastModified time.Time         `json:"LastModified,omitempty"`
	Parameters   map[string]string `json:"Parameters,omitempty"`
	Role         aws.StringValue   `json:"Role,omitempty"`
	Status       aws.StringValue   `json:"Status,omitempty"`
	UUID         aws.StringValue   `json:"UUID,omitempty"`
}

EventSourceConfiguration is undocumented.

type FunctionCodeLocation

type FunctionCodeLocation struct {
	Location       aws.StringValue `json:"Location,omitempty"`
	RepositoryType aws.StringValue `json:"RepositoryType,omitempty"`
}

FunctionCodeLocation is undocumented.

type FunctionConfiguration

type FunctionConfiguration struct {
	CodeSize        aws.LongValue    `json:"CodeSize,omitempty"`
	ConfigurationID aws.StringValue  `json:"ConfigurationId,omitempty"`
	Description     aws.StringValue  `json:"Description,omitempty"`
	FunctionARN     aws.StringValue  `json:"FunctionARN,omitempty"`
	FunctionName    aws.StringValue  `json:"FunctionName,omitempty"`
	Handler         aws.StringValue  `json:"Handler,omitempty"`
	LastModified    time.Time        `json:"LastModified,omitempty"`
	MemorySize      aws.IntegerValue `json:"MemorySize,omitempty"`
	Mode            aws.StringValue  `json:"Mode,omitempty"`
	Role            aws.StringValue  `json:"Role,omitempty"`
	Runtime         aws.StringValue  `json:"Runtime,omitempty"`
	Timeout         aws.IntegerValue `json:"Timeout,omitempty"`
}

FunctionConfiguration is undocumented.

type GetEventSourceRequest

type GetEventSourceRequest struct {
	UUID aws.StringValue `json:"-"`
}

GetEventSourceRequest is undocumented.

type GetFunctionConfigurationRequest

type GetFunctionConfigurationRequest struct {
	FunctionName aws.StringValue `json:"-"`
}

GetFunctionConfigurationRequest is undocumented.

type GetFunctionRequest

type GetFunctionRequest struct {
	FunctionName aws.StringValue `json:"-"`
}

GetFunctionRequest is undocumented.

type GetFunctionResponse

type GetFunctionResponse struct {
	Code          *FunctionCodeLocation  `json:"Code,omitempty"`
	Configuration *FunctionConfiguration `json:"Configuration,omitempty"`
}

GetFunctionResponse is undocumented.

type InvokeAsyncRequest

type InvokeAsyncRequest struct {
	FunctionName aws.StringValue `json:"-"`
	InvokeArgs   []byte          `json:"InvokeArgs"`
}

InvokeAsyncRequest is undocumented.

type InvokeAsyncResponse

type InvokeAsyncResponse struct {
	Status aws.IntegerValue `json:"-"`
}

InvokeAsyncResponse is undocumented.

type Lambda

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

Lambda is a client for Amazon Lambda.

func New

func New(creds aws.CredentialsProvider, region string, client *http.Client) *Lambda

New returns a new Lambda client.

func (*Lambda) AddEventSource

func (c *Lambda) AddEventSource(req *AddEventSourceRequest) (resp *EventSourceConfiguration, err error)

AddEventSource identifies an Amazon Kinesis stream as the event source for an AWS Lambda function. AWS Lambda invokes the specified function when records are posted to the stream. This is the pull model, where AWS Lambda invokes the function. For more information, go to AWS LambdaL How it Works in the AWS Lambda Developer Guide. This association between an Amazon Kinesis stream and an AWS Lambda function is called the event source mapping. You provide the configuration information (for example, which stream to read from and which AWS Lambda function to invoke) for the event source mapping in the request body. This operation requires permission for the iam:PassRole action for the IAM role. It also requires permission for the lambda:AddEventSource action.

func (*Lambda) DeleteFunction

func (c *Lambda) DeleteFunction(req *DeleteFunctionRequest) (err error)

DeleteFunction deletes the specified Lambda function code and configuration. This operation requires permission for the lambda:DeleteFunction action.

func (*Lambda) GetEventSource

func (c *Lambda) GetEventSource(req *GetEventSourceRequest) (resp *EventSourceConfiguration, err error)

GetEventSource returns configuration information for the specified event source mapping (see AddEventSource This operation requires permission for the lambda:GetEventSource action.

func (*Lambda) GetFunction

func (c *Lambda) GetFunction(req *GetFunctionRequest) (resp *GetFunctionResponse, err error)

GetFunction returns the configuration information of the Lambda function and a presigned URL link to the .zip file you uploaded with UploadFunction so you can download the .zip file. Note that the URL is valid for up to 10 minutes. The configuration information is the same information you provided as parameters when uploading the function. This operation requires permission for the lambda:GetFunction action.

func (*Lambda) GetFunctionConfiguration

func (c *Lambda) GetFunctionConfiguration(req *GetFunctionConfigurationRequest) (resp *FunctionConfiguration, err error)

GetFunctionConfiguration returns the configuration information of the Lambda function. This the same information you provided as parameters when uploading the function by using UploadFunction This operation requires permission for the lambda:GetFunctionConfiguration operation.

func (*Lambda) InvokeAsync

func (c *Lambda) InvokeAsync(req *InvokeAsyncRequest) (resp *InvokeAsyncResponse, err error)

InvokeAsync submits an invocation request to AWS Lambda. Upon receiving the request, Lambda executes the specified function asynchronously. To see the logs generated by the Lambda function execution, see the CloudWatch logs console. This operation requires permission for the lambda:InvokeAsync action.

func (*Lambda) ListEventSources

func (c *Lambda) ListEventSources(req *ListEventSourcesRequest) (resp *ListEventSourcesResponse, err error)

ListEventSources returns a list of event source mappings. For each mapping, the API returns configuration information (see AddEventSource ). You can optionally specify filters to retrieve specific event source mappings. This operation requires permission for the lambda:ListEventSources action.

func (*Lambda) ListFunctions

func (c *Lambda) ListFunctions(req *ListFunctionsRequest) (resp *ListFunctionsResponse, err error)

ListFunctions returns a list of your Lambda functions. For each function, the response includes the function configuration information. You must use GetFunction to retrieve the code for your function. This operation requires permission for the lambda:ListFunctions action.

func (*Lambda) RemoveEventSource

func (c *Lambda) RemoveEventSource(req *RemoveEventSourceRequest) (err error)

RemoveEventSource removes an event source mapping. This means AWS Lambda will no longer invoke the function for events in the associated source. This operation requires permission for the lambda:RemoveEventSource action.

func (*Lambda) UpdateFunctionConfiguration

func (c *Lambda) UpdateFunctionConfiguration(req *UpdateFunctionConfigurationRequest) (resp *FunctionConfiguration, err error)

UpdateFunctionConfiguration updates the configuration parameters for the specified Lambda function by using the values provided in the request. You provide only the parameters you want to change. This operation must only be used on an existing Lambda function and cannot be used to update the function's code. This operation requires permission for the lambda:UpdateFunctionConfiguration action.

func (*Lambda) UploadFunction

func (c *Lambda) UploadFunction(req *UploadFunctionRequest) (resp *FunctionConfiguration, err error)

UploadFunction creates a new Lambda function or updates an existing function. The function metadata is created from the request parameters, and the code for the function is provided by a .zip file in the request body. If the function name already exists, the existing Lambda function is updated with the new code and metadata. This operation requires permission for the lambda:UploadFunction action.

type LambdaAPI

type LambdaAPI interface {
	AddEventSource(req *AddEventSourceRequest) (resp *EventSourceConfiguration, err error)
	DeleteFunction(req *DeleteFunctionRequest) (err error)
	GetEventSource(req *GetEventSourceRequest) (resp *EventSourceConfiguration, err error)
	GetFunction(req *GetFunctionRequest) (resp *GetFunctionResponse, err error)
	GetFunctionConfiguration(req *GetFunctionConfigurationRequest) (resp *FunctionConfiguration, err error)
	InvokeAsync(req *InvokeAsyncRequest) (resp *InvokeAsyncResponse, err error)
	ListEventSources(req *ListEventSourcesRequest) (resp *ListEventSourcesResponse, err error)
	ListFunctions(req *ListFunctionsRequest) (resp *ListFunctionsResponse, err error)
	RemoveEventSource(req *RemoveEventSourceRequest) (err error)
	UpdateFunctionConfiguration(req *UpdateFunctionConfigurationRequest) (resp *FunctionConfiguration, err error)
	UploadFunction(req *UploadFunctionRequest) (resp *FunctionConfiguration, err error)
}

type ListEventSourcesRequest

type ListEventSourcesRequest struct {
	EventSourceARN aws.StringValue  `json:"-"`
	FunctionName   aws.StringValue  `json:"-"`
	Marker         aws.StringValue  `json:"-"`
	MaxItems       aws.IntegerValue `json:"-"`
}

ListEventSourcesRequest is undocumented.

type ListEventSourcesResponse

type ListEventSourcesResponse struct {
	EventSources []EventSourceConfiguration `json:"EventSources,omitempty"`
	NextMarker   aws.StringValue            `json:"NextMarker,omitempty"`
}

ListEventSourcesResponse is undocumented.

type ListFunctionsRequest

type ListFunctionsRequest struct {
	Marker   aws.StringValue  `json:"-"`
	MaxItems aws.IntegerValue `json:"-"`
}

ListFunctionsRequest is undocumented.

type ListFunctionsResponse

type ListFunctionsResponse struct {
	Functions  []FunctionConfiguration `json:"Functions,omitempty"`
	NextMarker aws.StringValue         `json:"NextMarker,omitempty"`
}

ListFunctionsResponse is undocumented.

type RemoveEventSourceRequest

type RemoveEventSourceRequest struct {
	UUID aws.StringValue `json:"-"`
}

RemoveEventSourceRequest is undocumented.

type UpdateFunctionConfigurationRequest

type UpdateFunctionConfigurationRequest struct {
	Description  aws.StringValue  `json:"-"`
	FunctionName aws.StringValue  `json:"-"`
	Handler      aws.StringValue  `json:"-"`
	MemorySize   aws.IntegerValue `json:"-"`
	Role         aws.StringValue  `json:"-"`
	Timeout      aws.IntegerValue `json:"-"`
}

UpdateFunctionConfigurationRequest is undocumented.

type UploadFunctionRequest

type UploadFunctionRequest struct {
	Description  aws.StringValue  `json:"-"`
	FunctionName aws.StringValue  `json:"-"`
	FunctionZip  []byte           `json:"FunctionZip"`
	Handler      aws.StringValue  `json:"-"`
	MemorySize   aws.IntegerValue `json:"-"`
	Mode         aws.StringValue  `json:"-"`
	Role         aws.StringValue  `json:"-"`
	Runtime      aws.StringValue  `json:"-"`
	Timeout      aws.IntegerValue `json:"-"`
}

UploadFunctionRequest is undocumented.

Jump to

Keyboard shortcuts

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