function

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_function_proto protoreflect.FileDescriptor

Functions

func NewFunctionEndpoints

func NewFunctionEndpoints() []*api.Endpoint

func RegisterFunctionHandler

func RegisterFunctionHandler(s server.Server, hdlr FunctionHandler, opts ...server.HandlerOption) error

Types

type CallRequest

type CallRequest struct {

	// Name of the function
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Request body that will be passed to the function
	Request *structpb.Struct `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	// contains filtered or unexported fields
}

Call a function by name

func (*CallRequest) Descriptor deprecated

func (*CallRequest) Descriptor() ([]byte, []int)

Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.

func (*CallRequest) GetName

func (x *CallRequest) GetName() string

func (*CallRequest) GetRequest

func (x *CallRequest) GetRequest() *structpb.Struct

func (*CallRequest) ProtoMessage

func (*CallRequest) ProtoMessage()

func (*CallRequest) ProtoReflect

func (x *CallRequest) ProtoReflect() protoreflect.Message

func (*CallRequest) Reset

func (x *CallRequest) Reset()

func (*CallRequest) String

func (x *CallRequest) String() string

type CallResponse

type CallResponse struct {

	// Response body that the function returned
	Response *structpb.Struct `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*CallResponse) Descriptor deprecated

func (*CallResponse) Descriptor() ([]byte, []int)

Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.

func (*CallResponse) GetResponse

func (x *CallResponse) GetResponse() *structpb.Struct

func (*CallResponse) ProtoMessage

func (*CallResponse) ProtoMessage()

func (*CallResponse) ProtoReflect

func (x *CallResponse) ProtoReflect() protoreflect.Message

func (*CallResponse) Reset

func (x *CallResponse) Reset()

func (*CallResponse) String

func (x *CallResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// The name of the function
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional project name
	Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

Delete a function by name

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetName

func (x *DeleteRequest) GetName() string

func (*DeleteRequest) GetProject

func (x *DeleteRequest) GetProject() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type DeployRequest

type DeployRequest struct {

	// github url to repo
	Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
	// optional subfolder path
	Subfolder string `protobuf:"bytes,2,opt,name=subfolder,proto3" json:"subfolder,omitempty"`
	// function name
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// entry point, ie. handler name in the source code
	// if not provided, defaults to the name parameter
	Entrypoint string `protobuf:"bytes,4,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
	// project is used for namespacing your functions
	// optional. defaults to "default".
	Project string `protobuf:"bytes,5,opt,name=project,proto3" json:"project,omitempty"`
	// 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 `protobuf:"bytes,6,opt,name=runtime,proto3" json:"runtime,omitempty"`
	// environment variables to pass in at runtime
	EnvVars map[string]string `` /* 170-byte string literal not displayed */
	// contains filtered or unexported fields
}

Deploy a group of functions

func (*DeployRequest) Descriptor deprecated

func (*DeployRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeployRequest.ProtoReflect.Descriptor instead.

func (*DeployRequest) GetEntrypoint

func (x *DeployRequest) GetEntrypoint() string

func (*DeployRequest) GetEnvVars

func (x *DeployRequest) GetEnvVars() map[string]string

func (*DeployRequest) GetName

func (x *DeployRequest) GetName() string

func (*DeployRequest) GetProject

func (x *DeployRequest) GetProject() string

func (*DeployRequest) GetRepo

func (x *DeployRequest) GetRepo() string

func (*DeployRequest) GetRuntime

func (x *DeployRequest) GetRuntime() string

func (*DeployRequest) GetSubfolder

func (x *DeployRequest) GetSubfolder() string

func (*DeployRequest) ProtoMessage

func (*DeployRequest) ProtoMessage()

func (*DeployRequest) ProtoReflect

func (x *DeployRequest) ProtoReflect() protoreflect.Message

func (*DeployRequest) Reset

func (x *DeployRequest) Reset()

func (*DeployRequest) String

func (x *DeployRequest) String() string

type DeployResponse

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

func (*DeployResponse) Descriptor deprecated

func (*DeployResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeployResponse.ProtoReflect.Descriptor instead.

func (*DeployResponse) ProtoMessage

func (*DeployResponse) ProtoMessage()

func (*DeployResponse) ProtoReflect

func (x *DeployResponse) ProtoReflect() protoreflect.Message

func (*DeployResponse) Reset

func (x *DeployResponse) Reset()

func (*DeployResponse) String

func (x *DeployResponse) String() string

type DescribeRequest

type DescribeRequest struct {

	// The name of the function
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional project name
	Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

Get the info for a deployed function

func (*DescribeRequest) Descriptor deprecated

func (*DescribeRequest) Descriptor() ([]byte, []int)

Deprecated: Use DescribeRequest.ProtoReflect.Descriptor instead.

func (*DescribeRequest) GetName

func (x *DescribeRequest) GetName() string

func (*DescribeRequest) GetProject

func (x *DescribeRequest) GetProject() string

func (*DescribeRequest) ProtoMessage

func (*DescribeRequest) ProtoMessage()

func (*DescribeRequest) ProtoReflect

func (x *DescribeRequest) ProtoReflect() protoreflect.Message

func (*DescribeRequest) Reset

func (x *DescribeRequest) Reset()

func (*DescribeRequest) String

func (x *DescribeRequest) String() string

type DescribeResponse

type DescribeResponse struct {

	// The function requested
	Function *Func `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"`
	// The time at which the function was updated
	UpdatedAt string `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// The timeout for requests to the function
	Timeout string `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeResponse) Descriptor deprecated

func (*DescribeResponse) Descriptor() ([]byte, []int)

Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead.

func (*DescribeResponse) GetFunction

func (x *DescribeResponse) GetFunction() *Func

func (*DescribeResponse) GetTimeout

func (x *DescribeResponse) GetTimeout() string

func (*DescribeResponse) GetUpdatedAt

func (x *DescribeResponse) GetUpdatedAt() string

func (*DescribeResponse) ProtoMessage

func (*DescribeResponse) ProtoMessage()

func (*DescribeResponse) ProtoReflect

func (x *DescribeResponse) ProtoReflect() protoreflect.Message

func (*DescribeResponse) Reset

func (x *DescribeResponse) Reset()

func (*DescribeResponse) String

func (x *DescribeResponse) String() string

type Func

type Func struct {

	// project of function, optional
	// defaults to literal "default"
	// used to namespace functions
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// function name
	// limitation: must be unique across projects
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// name of handler in source code
	Entrypoint string `protobuf:"bytes,3,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
	// git repo address
	Repo string `protobuf:"bytes,4,opt,name=repo,proto3" json:"repo,omitempty"`
	// subfolder path to entrypoint
	Subfolder string `protobuf:"bytes,5,opt,name=subfolder,proto3" json:"subfolder,omitempty"`
	// 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 `protobuf:"bytes,6,opt,name=runtime,proto3" json:"runtime,omitempty"`
	// eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc
	Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Func) Descriptor deprecated

func (*Func) Descriptor() ([]byte, []int)

Deprecated: Use Func.ProtoReflect.Descriptor instead.

func (*Func) GetEntrypoint

func (x *Func) GetEntrypoint() string

func (*Func) GetName

func (x *Func) GetName() string

func (*Func) GetProject

func (x *Func) GetProject() string

func (*Func) GetRepo

func (x *Func) GetRepo() string

func (*Func) GetRuntime

func (x *Func) GetRuntime() string

func (*Func) GetStatus

func (x *Func) GetStatus() string

func (*Func) GetSubfolder

func (x *Func) GetSubfolder() string

func (*Func) ProtoMessage

func (*Func) ProtoMessage()

func (*Func) ProtoReflect

func (x *Func) ProtoReflect() protoreflect.Message

func (*Func) Reset

func (x *Func) Reset()

func (*Func) String

func (x *Func) String() string

type FunctionService

type FunctionService interface {
	Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error)
	Deploy(ctx context.Context, in *DeployRequest, opts ...client.CallOption) (*DeployResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
	Describe(ctx context.Context, in *DescribeRequest, opts ...client.CallOption) (*DescribeResponse, error)
}

func NewFunctionService

func NewFunctionService(name string, c client.Client) FunctionService

type ListRequest

type ListRequest struct {

	// optional project name
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

List all the deployed functions

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetProject

func (x *ListRequest) GetProject() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {

	// List of functions deployed
	Functions []*Func `protobuf:"bytes,1,rep,name=functions,proto3" json:"functions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetFunctions

func (x *ListResponse) GetFunctions() []*Func

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

Jump to

Keyboard shortcuts

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