function

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallRequest

type CallRequest struct {
	// Name of the function
	Name string `json:"name"`
	// Request body that will be passed to the function
	Request map[string]interface{} `json:"request"`
}

type CallResponse

type CallResponse struct {
	// Response body that the function returned
	Response map[string]interface{} `json:"response"`
}

type DeleteRequest

type DeleteRequest struct {
	// The name of the function
	Name string `json:"name"`
	// Optional project name
	Project string `json:"project"`
}

type DeleteResponse

type DeleteResponse struct {
}

type DeployRequest

type DeployRequest struct {
	// entry point, ie. handler name in the source code
	// if not provided, defaults to the name parameter
	Entrypoint string `json:"entrypoint"`
	// environment variables to pass in at runtime
	EnvVars map[string]string `json:"envVars"`
	// function name
	Name string `json:"name"`
	// project is used for namespacing your functions
	// optional. defaults to "default".
	Project string `json:"project"`
	// github url to repo
	Repo string `json:"repo"`
	// runtime/language of the function
	// eg: php74,
	// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16
	// dotnet3
	// java11
	// ruby26, ruby27
	// go111, go113, go116
	// python37, python38, python39
	Runtime string `json:"runtime"`
	// optional subfolder path
	Subfolder string `json:"subfolder"`
}

type DeployResponse

type DeployResponse struct {
}

type DescribeRequest

type DescribeRequest struct {
	// The name of the function
	Name string `json:"name"`
	// Optional project name
	Project string `json:"project"`
}

type DescribeResponse

type DescribeResponse struct {
	// The function requested
	Function *Func `json:"function"`
	// The timeout for requests to the function
	Timeout string `json:"timeout"`
	// The time at which the function was updated
	UpdatedAt string `json:"updatedAt"`
}

type Func

type Func struct {
	// name of handler in source code
	Entrypoint string `json:"entrypoint"`
	// function name
	// limitation: must be unique across projects
	Name string `json:"name"`
	// project of function, optional
	// defaults to literal "default"
	// used to namespace functions
	Project string `json:"project"`
	// git repo address
	Repo string `json:"repo"`
	// runtime/language of the function
	// eg: php74,
	// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16
	// dotnet3
	// java11
	// ruby26, ruby27
	// go111, go113, go116
	// python37, python38, python39
	Runtime string `json:"runtime"`
	// eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc
	Status string `json:"status"`
	// subfolder path to entrypoint
	Subfolder string `json:"subfolder"`
}

type FunctionService

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

func NewFunctionService

func NewFunctionService(token string) *FunctionService

func (*FunctionService) Call

func (t *FunctionService) Call(request *CallRequest) (*CallResponse, error)

Call a function by name

func (*FunctionService) Delete

func (t *FunctionService) Delete(request *DeleteRequest) (*DeleteResponse, error)

Delete a function by name

func (*FunctionService) Deploy

func (t *FunctionService) Deploy(request *DeployRequest) (*DeployResponse, error)

Deploy a group of functions

func (*FunctionService) Describe

func (t *FunctionService) Describe(request *DescribeRequest) (*DescribeResponse, error)

Get the info for a deployed function

func (*FunctionService) List

func (t *FunctionService) List(request *ListRequest) (*ListResponse, error)

List all the deployed functions

type ListRequest

type ListRequest struct {
	// optional project name
	Project string `json:"project"`
}

type ListResponse

type ListResponse struct {
	// List of functions deployed
	Functions []Func `json:"functions"`
}

Jump to

Keyboard shortcuts

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