functioncontext

package
v0.0.0-...-13c9a7e Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FunctionName string

FunctionName the name of the current Function

View Source
var FunctionVersion string

FunctionVersion is the published version of the current instance of the Function

View Source
var MemoryLimitInMB int

MemoryLimitInMB is the configured memory limit for the current instance of the Function

Functions

func NewContext

func NewContext(parent context.Context, lc *FunctionContext) context.Context

NewContext returns a new Context that carries value lc.

Types

type ClientApplication

type ClientApplication struct {
	InstallationID string `json:"installation_id"`
	AppTitle       string `json:"app_title"`
	AppVersionCode string `json:"app_version_code"`
	AppPackageName string `json:"app_package_name"`
}

ClientApplication is metadata about the calling application.

type ClientContext

type ClientContext struct {
	Client ClientApplication
	Env    map[string]string `json:"env"`
	Custom map[string]string `json:"custom"`
}

ClientContext is information about the client application passed by the calling application.

type FunctionContext

type FunctionContext struct {
	RequestID             string
	InvokedFunctionUnique string
	ClientContext         ClientContext
	Namespace             string
	FunctionName          string
	FunctionVersion       string
	MemoryLimitInMb       int32
	TimeLimitInMs         int32
	Environment           map[string]string
	TencentcloudRegion    string
	TencentcloudAppID     string
	TencentcloudUin       string
	FunctionTrace         string
}

FunctionContext is the set of metadata that is passed for every Invoke.

func FromContext

func FromContext(ctx context.Context) (*FunctionContext, bool)

FromContext returns the FunctionContext value stored in ctx, if any.

Jump to

Keyboard shortcuts

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