Documentation ¶
Index ¶
- Constants
- Variables
- func DecideRevisionName(fm FunctionManifest, commit string) (string, error)
- func FindArtifactVersions(fm FunctionManifest) ([]*model.ArtifactVersion, error)
- func FindImageTag(fm FunctionManifest) (string, error)
- type Architecture
- type Client
- type EphemeralStorage
- type FunctionManifest
- type FunctionManifestSpec
- type Registry
- type RoutingTrafficConfig
- type SourceCode
- type TrafficConfigKeyName
- type VPCConfig
- type VersionTraffic
Constants ¶
const ( // RequestRetryTime represents the number of times calling to AWS resource control. RequestRetryTime = 3 // RetryIntervalDuration represents duration time between retry. RetryIntervalDuration = 1 * time.Minute )
Variables ¶
var ErrNotFound = errors.New("lambda resource not found")
ErrNotFound lambda resource occurred.
Functions ¶
func DecideRevisionName ¶
func DecideRevisionName(fm FunctionManifest, commit string) (string, error)
DecideRevisionName returns revision name to apply.
func FindArtifactVersions ¶
func FindArtifactVersions(fm FunctionManifest) ([]*model.ArtifactVersion, error)
FindArtifactVersions parses artifact versions from function.yaml.
func FindImageTag ¶
func FindImageTag(fm FunctionManifest) (string, error)
FindImageTag parses image tag from given LambdaFunction manifest.
Types ¶
type Architecture ¶ added in v0.44.0
type Architecture struct {
Name string `json:"name"`
}
type Client ¶
type Client interface { IsFunctionExist(ctx context.Context, name string) (bool, error) CreateFunction(ctx context.Context, fm FunctionManifest) error CreateFunctionFromSource(ctx context.Context, fm FunctionManifest, zip io.Reader) error UpdateFunction(ctx context.Context, fm FunctionManifest) error UpdateFunctionFromSource(ctx context.Context, fm FunctionManifest, zip io.Reader) error PublishFunction(ctx context.Context, fm FunctionManifest) (version string, err error) GetTrafficConfig(ctx context.Context, fm FunctionManifest) (routingTrafficCfg RoutingTrafficConfig, err error) CreateTrafficConfig(ctx context.Context, fm FunctionManifest, version string) error UpdateTrafficConfig(ctx context.Context, fm FunctionManifest, routingTraffic RoutingTrafficConfig) error }
Client is wrapper of AWS client.
type EphemeralStorage ¶ added in v0.45.4
type EphemeralStorage struct {
Size int32 `json:"size,omitempty"`
}
type FunctionManifest ¶
type FunctionManifest struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion,omitempty"` Spec FunctionManifestSpec `json:"spec"` }
func LoadFunctionManifest ¶
func LoadFunctionManifest(appDir, functionManifestFilename string) (FunctionManifest, error)
LoadFunctionManifest returns FunctionManifest object from a given Function config manifest file.
type FunctionManifestSpec ¶
type FunctionManifestSpec struct { Name string `json:"name"` Role string `json:"role"` ImageURI string `json:"image"` S3Bucket string `json:"s3Bucket"` S3Key string `json:"s3Key"` S3ObjectVersion string `json:"s3ObjectVersion"` SourceCode SourceCode `json:"source"` Handler string `json:"handler"` Architectures []Architecture `json:"architectures,omitempty"` EphemeralStorage *EphemeralStorage `json:"ephemeralStorage,omitempty"` Runtime string `json:"runtime"` Memory int32 `json:"memory"` Timeout int32 `json:"timeout"` Tags map[string]string `json:"tags,omitempty"` Environments map[string]string `json:"environments,omitempty"` VPCConfig *VPCConfig `json:"vpcConfig,omitempty"` }
FunctionManifestSpec contains configuration for LambdaFunction.
type Registry ¶
type Registry interface {
Client(name string, cfg *config.PlatformProviderLambdaConfig, logger *zap.Logger) (Client, error)
}
Registry holds a pool of aws client wrappers.
func DefaultRegistry ¶
func DefaultRegistry() Registry
DefaultRegistry returns a pool of aws clients and a mutex associated with it.
type RoutingTrafficConfig ¶
type RoutingTrafficConfig map[TrafficConfigKeyName]VersionTraffic
RoutingTrafficConfig presents a map of primary and secondary version traffic for lambda function alias.
func (*RoutingTrafficConfig) Decode ¶
func (c *RoutingTrafficConfig) Decode(data []byte) error
func (*RoutingTrafficConfig) Encode ¶
func (c *RoutingTrafficConfig) Encode() (string, error)
type SourceCode ¶
type TrafficConfigKeyName ¶
type TrafficConfigKeyName string
TrafficConfigKeyName represents key for lambda service config map.
const ( // TrafficPrimaryVersionKeyName represents the key points to primary version config on traffic routing map. TrafficPrimaryVersionKeyName TrafficConfigKeyName = "primary" // TrafficSecondaryVersionKeyName represents the key points to primary version config on traffic routing map. TrafficSecondaryVersionKeyName TrafficConfigKeyName = "secondary" )
type VersionTraffic ¶
VersionTraffic presents the version, and the percent of traffic that's routed to it.