Documentation
¶
Index ¶
- Constants
- Variables
- func GetLogToBody(c *routing.Context) bool
- func IsNoneLogType(logType string) bool
- type Alias
- type CPUStats
- type CodeStorage
- type Concurrency
- type ContainerInfo
- type ContainerInfoResponse
- type CoolDownRequest
- type Environment
- type Event
- type EventLock
- type FreezerState
- type FuncletClientContainerInfoInput
- type FuncletClientCoolDownInput
- type FuncletClientListContainersInput
- type FuncletClientListNodeInput
- type FuncletClientRebornInput
- type FuncletClientWarmUpInput
- type FuncletNodeInfo
- type FuncletResource
- type FunctionCodeLocation
- type FunctionConfig
- type FunctionConfiguration
- type GetAliasInput
- type GetAliasOutput
- type GetFunctionInput
- type GetFunctionOutput
- type GetRuntimeConfigurationInput
- type InvokeHeaders
- type InvokeProxyRequest
- type InvokeProxyResponse
- type InvokeRequest
- type InvokeResponse
- func (iresp *InvokeResponse) Body() []byte
- func (iresp *InvokeResponse) BodyStream() io.ReadCloser
- func (iresp *InvokeResponse) BodyString() *string
- func (iresp *InvokeResponse) GetHeader(k string) (v string, ok bool)
- func (iresp *InvokeResponse) Headers() *map[string]string
- func (iresp *InvokeResponse) SetBody(b []byte)
- func (iresp *InvokeResponse) SetBodyStream(bs io.ReadCloser)
- func (iresp *InvokeResponse) SetHeader(k, v string)
- func (iresp *InvokeResponse) SetHeaders(hMap *map[string]string)
- func (iresp *InvokeResponse) SetStatusCode(c int)
- func (iresp *InvokeResponse) StatusCode() int
- type InvokeType
- type ListContainerCriteria
- type ListContainersResponse
- type LogConfiguration
- type LogType
- type MemoryStats
- type ProxyRequest
- type ProxyResponse
- type RebornRequest
- type ResetRequest
- type ResetResponse
- type Resource
- type ResourceStats
- type RuntimeConfiguration
- type ScaleDownImplementationResult
- type ScaleDownRecommendation
- type ScaleUpRecommendation
- type ServiceResource
- type TriggerType
- type User
- type WarmUpContainerArgs
- type WarmUpResponse
- type WarmupRequest
Constants ¶
View Source
const ( LogTypeNone = "None" LogTypeTail = "Tail" )
View Source
const ( InvokeTypeCommon InvokeType = "common" InvokeTypeEvent = "event" InvokeTypeStream = "stream" InvokeTypeHttpTrigger = "httpTrigger" InvokeTypeMqhub = "mqhub" )
View Source
const ( TriggerTypeHTTP TriggerType = "faas-http-trigger" TriggerTypeCrontab = "faas-crontab-trigger" TriggerTypeKafka = "kafka" TriggerTypeVscode = "vscode" TriggerTypeGeneric = "generic" )
View Source
const ( RunningModeCommon = "common" RunningModeIDE = "ide" )
View Source
const ( TmpStorageTypeLoop = "loop" TmpStorageTypeHostPath = "host-path" )
View Source
const ( RuntimeViaWarm = "warm" RuntimeViaCold = "cold" RuntimeViaUnknown = "unknown" )
View Source
const ( HeaderXRequestID = "X-easyfaas-Request-Id" HeaderXAccountID = "X-easyfaas-Account-Id" HeaderAuthorization = "Authorization" AppNameKey = "app" HeaderInvokeType = "X-easyfaas-Invoke-Type" HeaderLogType = "Log-Type" HeaderLogToBody = "Log-To-Body" HeaderXAuthToken = "X-Auth-Token" BceFaasUIDKey = "BCE-FAAS-UID" BceFaasTriggerKey = "X-easyfaas-Faas-Trigger" XBceFunctionError = "X-easyfaas-Function-Error" HeadereasyfaasExecTime = "X-easyfaas-Function-Exectime" HeaderLogResult = "X-Bce-Log-Result" QueryLogType = "logType" QueryLogToBody = "logToBody" )
View Source
const (
ContainerIDsParams = "ContainerIDs"
)
View Source
const MinMemorySize int64 = 128
Variables ¶
View Source
var ( RegfunctionName = regexp.MustCompile("^[a-zA-Z0-9-_]+$") RegVersion = regexp.MustCompile("^(\\$LATEST|([0-9]+))$") )
Functions ¶
func GetLogToBody ¶
func GetLogToBody(c *routing.Context) bool
func IsNoneLogType ¶
Types ¶
type Concurrency ¶
type Concurrency struct {
lambda.PutFunctionConcurrencyOutput
AccountReservedSum int
}
Concurrency xxx
type ContainerInfo ¶
type ContainerInfo struct {
Hostname string
ContainerID string
HostPid int
EventLock EventLock
CurrentEvent Event
WithStreamMode bool
IsFrozen bool
Resource *Resource
ResourceStats *ResourceStats
}
func (*ContainerInfo) Copy ¶
func (c *ContainerInfo) Copy() (nc *ContainerInfo)
func (*ContainerInfo) MarshalLogObject ¶
func (c *ContainerInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject is marshaler for ContainerInfo
type ContainerInfoResponse ¶
type ContainerInfoResponse = ContainerInfo
type CoolDownRequest ¶
type CoolDownRequest struct {
ContainerID string
RequestID string
ScaleDownRecommendation *ScaleDownRecommendation
}
type EventLock ¶
type EventLock struct {
// contains filtered or unexported fields
}
func NewEventLock ¶
func NewEventLock() EventLock
type FreezerState ¶
type FreezerState string
const ( Undefined FreezerState = "" Frozen FreezerState = "FROZEN" Thawed FreezerState = "THAWED" )
type FuncletClientCoolDownInput ¶
type FuncletClientCoolDownInput struct {
Host string
ContainerID string
RequestID string
ScaleDownRecommendation *ScaleDownRecommendation
}
type FuncletClientListContainersInput ¶
type FuncletClientListContainersInput struct {
Host string
Criteria *ListContainerCriteria
RequestID string
}
type FuncletClientListNodeInput ¶
type FuncletClientListNodeInput struct {
RequestID string
}
type FuncletClientRebornInput ¶
type FuncletClientRebornInput struct {
ContainerID string
RequestID string
ScaleDownRecommendation *ScaleDownRecommendation
}
type FuncletClientWarmUpInput ¶
type FuncletClientWarmUpInput struct {
ContainerID string
RequestID string
Code *FunctionCodeLocation
Configuration *FunctionConfiguration
RuntimeConfiguration *RuntimeConfiguration
NeedScaleUp bool
ScaleUpRecommendation *ScaleUpRecommendation
WithStreamMode bool // TODO: remove it after apiserver deployed in production
}
type FuncletNodeInfo ¶
type FuncletNodeInfo struct {
Resource *FuncletResource
}
type FuncletResource ¶
type FuncletResource struct {
BaseMemory uint64
Default *Resource
Capacity *Resource
Reserved *Resource
Allocatable *Resource
}
func NewFuncletResource ¶
func NewFuncletResource() *FuncletResource
type FunctionCodeLocation ¶
type FunctionCodeLocation struct {
lambda.FunctionCodeLocation
LogType string
}
FunctionCodeLocation
type FunctionConfig ¶
type FunctionConfig struct {
CodeSha256 string
CodeSize int32
FunctionArn string
FunctionName string
Handler string
Version string
Runtime string
MemorySize *int
Timeout *int
Environment *Environment
CommitID *string `json:"CommitId"`
LogType string `json:",omitempty"`
LogBosDir string `json:",omitempty"`
PodConcurrentQuota *int `json:"PodConcurrentQuota"`
}
FunctionConfig
type FunctionConfiguration ¶
type FunctionConfiguration struct {
lambda.FunctionConfiguration
CommitID *string `json:"CommitId,omitempty"`
Uid string `json:",omitempty"`
LogType string `json:",omitempty"`
LogBosDir string `json:",omitempty"`
PodConcurrentQuota uint64 `json:",omitempty"`
}
FunctionConfiguration
func (*FunctionConfiguration) SetCommitID ¶
func (s *FunctionConfiguration) SetCommitID(v string) *FunctionConfiguration
func (*FunctionConfiguration) String ¶
func (s *FunctionConfiguration) String() string
type GetAliasInput ¶
type GetAliasInput struct {
FunctionBrn string
FunctionName string
Qualifier string
Authorization string
RequestID string
AccountID string
WithCache bool
SimpleAuth bool
}
GetFunctionInput
type GetAliasOutput ¶
type GetAliasOutput = Alias
type GetFunctionInput ¶
type GetFunctionInput struct {
Authorization string
lambda.GetFunctionInput
RequestID string
AccountID string
WithCache bool
SimpleAuth bool
}
GetFunctionInput
type GetFunctionOutput ¶
type GetFunctionOutput struct {
// The object for the Lambda function location.
Code *FunctionCodeLocation `type:"structure"`
// The concurrent execution limit set for this function. For more information,
// see concurrent-executions.
Concurrency *Concurrency `type:"structure",json:",omitempty"`
// A complex type that describes function metadata.
Configuration *FunctionConfiguration `type:"structure"`
LogConfig *LogConfiguration `type:"structure",json:",omitempty"`
Uid string `json:",omitempty"`
LogType string `json:",omitempty"`
PodConcurrentQuota *uint64 `json:",omitempty"`
// Returns the list of tags associated with the function.
Tags map[string]*string `type:"map",json:",omitempty"`
}
GetFunctionOutput
type GetRuntimeConfigurationInput ¶
type GetRuntimeConfigurationInput struct {
Authorization string
RuntimeName string
RequestID string
}
GetFunctionInput
type InvokeHeaders ¶
func (InvokeHeaders) Get ¶
func (h InvokeHeaders) Get(k string) string
func (InvokeHeaders) Set ¶
func (h InvokeHeaders) Set(k, v string)
type InvokeProxyRequest ¶
type InvokeProxyRequest struct {
Headers map[string]string
Body []byte
BodyStream io.ReadWriter
IsBase64Encoded bool
}
func NewInvokeProxyRequest ¶
func NewInvokeProxyRequest(headers map[string]string, body []byte, bodyStream io.ReadWriter) *InvokeProxyRequest
func (*InvokeProxyRequest) SetBody ¶
func (ir *InvokeProxyRequest) SetBody(msg []byte)
func (*InvokeProxyRequest) SetHeader ¶
func (ir *InvokeProxyRequest) SetHeader(k string, v string)
type InvokeProxyResponse ¶
type InvokeProxyResponse struct {
StatusCode int
Headers map[string]string
Body []byte
BodyStream io.ReadCloser
IsBase64Encoded bool
}
func NewInvokeProxyResponse ¶
func NewInvokeProxyResponse() *InvokeProxyResponse
func NewInvokeProxyResponseWithRequestID ¶
func NewInvokeProxyResponseWithRequestID(requestID string) *InvokeProxyResponse
func (*InvokeProxyResponse) SetBody ¶
func (ir *InvokeProxyResponse) SetBody(msg []byte)
func (*InvokeProxyResponse) SetHeader ¶
func (ir *InvokeProxyResponse) SetHeader(k string, v string)
func (*InvokeProxyResponse) SetStatusCode ¶
func (ir *InvokeProxyResponse) SetStatusCode(c int)
type InvokeRequest ¶
type InvokeRequest struct {
UserID string
Authorization string
FunctionName string
Qualifier string
FunctionBRN string
Queries url.Values
Headers InvokeHeaders
Body *string
BodyStream io.ReadWriter
WithBodyStream bool
LogToBody bool
LogType LogType
RequestID string
InvokeType string
TriggerType string
}
type InvokeResponse ¶
type InvokeResponse struct {
IsBase64Encoded bool
// contains filtered or unexported fields
}
func NewInvokeResponse ¶
func NewInvokeResponse() *InvokeResponse
func (*InvokeResponse) Body ¶
func (iresp *InvokeResponse) Body() []byte
func (*InvokeResponse) BodyStream ¶
func (iresp *InvokeResponse) BodyStream() io.ReadCloser
func (*InvokeResponse) BodyString ¶
func (iresp *InvokeResponse) BodyString() *string
func (*InvokeResponse) GetHeader ¶
func (iresp *InvokeResponse) GetHeader(k string) (v string, ok bool)
func (*InvokeResponse) Headers ¶
func (iresp *InvokeResponse) Headers() *map[string]string
func (*InvokeResponse) SetBody ¶
func (iresp *InvokeResponse) SetBody(b []byte)
func (*InvokeResponse) SetBodyStream ¶
func (iresp *InvokeResponse) SetBodyStream(bs io.ReadCloser)
func (*InvokeResponse) SetHeader ¶
func (iresp *InvokeResponse) SetHeader(k, v string)
func (*InvokeResponse) SetHeaders ¶
func (iresp *InvokeResponse) SetHeaders(hMap *map[string]string)
func (*InvokeResponse) SetStatusCode ¶
func (iresp *InvokeResponse) SetStatusCode(c int)
func (*InvokeResponse) StatusCode ¶
func (iresp *InvokeResponse) StatusCode() int
type InvokeType ¶
type InvokeType = string
type ListContainerCriteria ¶
type ListContainerCriteria struct {
rest.QueryCriteria
}
func NewListContainerCriteria ¶
func NewListContainerCriteria() *ListContainerCriteria
func (*ListContainerCriteria) AddContainerIDs ¶
func (c *ListContainerCriteria) AddContainerIDs(IDs []string)
func (*ListContainerCriteria) ReadContainerIDs ¶
func (c *ListContainerCriteria) ReadContainerIDs() (IDs []string, err error)
type ListContainersResponse ¶
type ListContainersResponse []*ContainerInfo
type LogConfiguration ¶
func (LogConfiguration) String ¶
func (c LogConfiguration) String() string
type LogType ¶
type LogType string
func GetLogType ¶
func GetLogType(c *routing.Context) LogType
func (LogType) IsLogTypeTail ¶
IsLogTypeTail check if logtype is Tail
type MemoryStats ¶
type MemoryStats struct {
// Memory usage (in bytes).
Usage int64
// Memory limit (in bytes)
Limit int64
// MemorySwap Limit (in bytes)
SwapLimit int64
}
MemoryStats holds the on-demand stastistics from the memory cgroup
type ProxyRequest ¶
type ProxyResponse ¶
type RebornRequest ¶
type RebornRequest struct {
ContainerID string
RequestID string
ScaleDownRecommendation *ScaleDownRecommendation
}
type ResetRequest ¶
type ResetRequest struct {
ContainerID string
RequestID string
ScaleDownRecommendation *ScaleDownRecommendation
}
type ResetResponse ¶
type ResetResponse struct {
ScaleDownResult *ScaleDownImplementationResult
}
func NewResetResponse ¶
func NewResetResponse() *ResetResponse
type Resource ¶
func NewResource ¶
func NewResource() *Resource
type ResourceStats ¶
type ResourceStats struct {
// Memory statistics.
MemoryStats *MemoryStats
CPUStats *CPUStats
FreezerState FreezerState
}
ResourceStats holds on-demand stastistics from various cgroup subsystems
type RuntimeConfiguration ¶
RuntimeConfiguration
type ScaleDownImplementationResult ¶
type ScaleDownImplementationResult struct {
Success []string
Fails map[string]*ContainerInfo
}
func NewScaleDownImplementationResult ¶
func NewScaleDownImplementationResult() *ScaleDownImplementationResult
type ScaleDownRecommendation ¶
type ScaleUpRecommendation ¶
type ServiceResource ¶
type ServiceResource struct {
Capacity *Resource
Allocatable *Resource
Used *Resource
Marked *Resource
Default *Resource
BaseMemory uint64
}
func (*ServiceResource) Copy ¶
func (r *ServiceResource) Copy() *ServiceResource
type TriggerType ¶
type TriggerType = string
type User ¶
type User struct {
// ID xxx
ID string
// AccessKeyID xxx
AccessKeyID string
// AccessKeySecret xxx
AccessKeySecret string
}
User represent a user's credential
type WarmUpContainerArgs ¶
type WarmUpContainerArgs struct {
Code *CodeStorage
Configuration *FunctionConfig
RuntimeConfiguration *RuntimeConfiguration
ScaleUpRecommendation *ScaleUpRecommendation
WithStreamMode bool // TODO: remove it after apiserver deployed in production
}
type WarmUpResponse ¶
type WarmUpResponse struct {
Container ContainerInfo
}
type WarmupRequest ¶
type WarmupRequest struct {
ContainerID string
RequestID string
*WarmUpContainerArgs
}
Click to show internal directories.
Click to hide internal directories.