cfc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cfc

Index

Constants

View Source
const (
	BCE_USER_CODE_ROOT        = "BCE_USER_CODE_ROOT"
	BCE_CFC_INVOKE_PIPE       = "BCE_CFC_INVOKE_PIPE"
	BCE_CFC_RESPONSE_PIPE     = "BCE_CFC_RESPONSE_PIPE"
	BCE_USER_FUNCTION_BRN     = "BCE_USER_FUNCTION_BRN"
	BCE_USER_FUNCTION_NAME    = "BCE_USER_FUNCTION_NAME"
	BCE_USER_FUNCTION_MEMSIZE = "BCE_USER_FUNCTION_MEMSIZE"
	BCE_USER_FUNCTION_VERSION = "BCE_USER_FUNCTION_VERSION"
	BCE_USER_FUNCTION_HANDLER = "BCE_USER_FUNCTION_HANDLER"
)
View Source
const (
	MAX_INVOKE_EVENT_LENGTH = 6 * 1024 * 1024
)

Variables

This section is empty.

Functions

func Main

func Main() error

func RegisterNamedHandler

func RegisterNamedHandler(name string, h InvokeHandler)

Types

type CfcClient

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

func NewCfcClient

func NewCfcClient(c *RuntimeConfig, maxEventSize int) *CfcClient

func (*CfcClient) Close

func (iv *CfcClient) Close()

func (*CfcClient) WaitInvoke

func (iv *CfcClient) WaitInvoke() error

type Credential

type Credential struct {
	AccessKeyId     string
	AccessKeySecret string
	SessionToken    string
}

type InvokeContext

type InvokeContext interface {
	GetRequestID() string
	GetFunctionBrn() string
	GetFunctionName() string
	GetFunctionVersion() string
	GetMemoryLimitMB() int
	GetCredential() *Credential
	GetClientContext() []byte
}

func NewInvokeContext

func NewInvokeContext(reqId string, config *RuntimeConfig, credential *Credential, clientCtx []byte) InvokeContext

type InvokeError added in v1.1.0

type InvokeError struct {
	ErrorMessage string `json:"errorMessage"`
	ErrorType    string `json:"errorType"`
	StackTrace   string `json:"stackTrace,omitempty"`
}

type InvokeHandler

type InvokeHandler interface {
	Handle(input io.Reader, output io.Writer, context InvokeContext) error
}

type InvokeRequest

type InvokeRequest struct {
	RequestID       string
	AccessKeyID     string `json:"accessKey"`
	AccessKeySecret string `json:"secretKey"`
	SecurityToken   string `json:"securityToken"`
	FunctionBrn     string
	FunctionTimeout int
	ClientContext   string `json:",omitempty"`
	EventObject     string `json:",omitempty"`
}

type InvokeResponse

type InvokeResponse struct {
	RequestID  string
	Success    bool
	FuncResult string `json:"result,omitempty"`
	FuncError  string `json:"error,omitempty"`
}

type MissingHandlerError added in v1.1.0

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

func (MissingHandlerError) Error added in v1.1.0

func (e MissingHandlerError) Error() string

type RuntimeConfig

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

func NewRuntimeConfig

func NewRuntimeConfig() (*RuntimeConfig, error)

func (*RuntimeConfig) FunctionBrn

func (c *RuntimeConfig) FunctionBrn() string

func (*RuntimeConfig) FunctionName

func (c *RuntimeConfig) FunctionName() string

func (*RuntimeConfig) FunctionVersion

func (c *RuntimeConfig) FunctionVersion() string

func (*RuntimeConfig) Handler

func (c *RuntimeConfig) Handler() string

func (*RuntimeConfig) InvokePipe

func (c *RuntimeConfig) InvokePipe() int

func (*RuntimeConfig) MemorySize

func (c *RuntimeConfig) MemorySize() int

func (*RuntimeConfig) ResponsePipe

func (c *RuntimeConfig) ResponsePipe() int

func (*RuntimeConfig) StartTime

func (c *RuntimeConfig) StartTime() time.Time

func (*RuntimeConfig) UserCodeRoot

func (c *RuntimeConfig) UserCodeRoot() string

Jump to

Keyboard shortcuts

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