Documentation
¶
Index ¶
- Variables
- func Init(config *app.Config)
- func LaunchPlugin(originPackage []byte, decoder decoder.PluginDecoder, timeout int, ...) (*stream.Stream[LaunchFunctionResponse], error)
- func Ping() error
- func SetupFunction(manifest plugin_entities.PluginDeclaration, checksum string, context io.Reader, ...) (*stream.Stream[LaunchFunctionResponse], error)
- type LaunchFunctionEvent
- type LaunchFunctionFinalStageMessage
- type LaunchFunctionResponse
- type LaunchFunctionResponseChunk
- type LaunchStage
- type LaunchState
- type RunnerInstance
- type RunnerInstances
- type ServerlessFunction
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AWS_LAUNCH_LOCK_PREFIX = "aws_launch_lock_"
)
View Source
var (
ErrFunctionNotFound = errors.New("no function found")
)
View Source
var (
SERVERLESS_CONNECTOR_API_KEY string
)
Functions ¶
func LaunchPlugin ¶
func LaunchPlugin( originPackage []byte, decoder decoder.PluginDecoder, timeout int, ignoreIdempotent bool, ) (*stream.Stream[LaunchFunctionResponse], error)
LaunchPlugin uploads the plugin to specific serverless connector return the function url and name
func SetupFunction ¶
func SetupFunction( manifest plugin_entities.PluginDeclaration, checksum string, context io.Reader, timeout int, ) (*stream.Stream[LaunchFunctionResponse], error)
Setup the function from serverless connector, it will receive the context as the input and build it a docker image, then run it on serverless platform like AWS Lambda it returns a event stream, the caller should consider it as a async operation
Types ¶
type LaunchFunctionEvent ¶
type LaunchFunctionEvent string
const ( Error LaunchFunctionEvent = "error" Info LaunchFunctionEvent = "info" Function LaunchFunctionEvent = "function" FunctionUrl LaunchFunctionEvent = "function_url" Done LaunchFunctionEvent = "done" )
type LaunchFunctionResponse ¶
type LaunchFunctionResponse struct { Event LaunchFunctionEvent `json:"event"` Message string `json:"message"` }
type LaunchFunctionResponseChunk ¶
type LaunchFunctionResponseChunk struct { Stage LaunchStage `json:"Stage"` Obj string `json:"Obj"` State LaunchState `json:"State"` Message string `json:"Message"` }
type LaunchStage ¶
type LaunchStage string
const ( LAUNCH_STAGE_HEALTHZ LaunchStage = "healthz" LAUNCH_STAGE_START LaunchStage = "start" LAUNCH_STAGE_BUILD LaunchStage = "build" LAUNCH_STAGE_RUN LaunchStage = "run" LAUNCH_STAGE_END LaunchStage = "end" )
type LaunchState ¶
type LaunchState string
const ( LAUNCH_STATE_SUCCESS LaunchState = "success" LAUNCH_STATE_RUNNING LaunchState = "running" LAUNCH_STATE_FAILED LaunchState = "failed" )
type RunnerInstance ¶
type RunnerInstance struct { ID string `json:"ID" validate:"required"` Name string `json:"Name" validate:"required"` Endpoint string `json:"Endpoint" validate:"required"` ResourceName string `json:"ResourceName" validate:"required"` Status struct { State string `json:"State" validate:"required"` } `json:"Status" validate:"required"` }
type RunnerInstances ¶
type RunnerInstances struct { Error string `json:"error"` Items []RunnerInstance `json:"Items"` }
type ServerlessFunction ¶
type ServerlessFunction struct { FunctionName string `json:"function_name" validate:"required"` FunctionDRN string `json:"function_drn" validate:"required"` FunctionURL string `json:"function_url" validate:"required"` }
func FetchFunction ¶
func FetchFunction(manifest plugin_entities.PluginDeclaration, checksum string) (*ServerlessFunction, error)
Fetch the function from serverless connector, return error if failed
Click to show internal directories.
Click to hide internal directories.