Documentation ¶
Index ¶
- Constants
- func AesDecryptText(fieldID int64, realEncryptKey []byte, encryptedText string) (originText string, err error)
- func BoolPtr(val bool) *bool
- func BoolValueOfPtr(val *bool) bool
- func CanOpenAPIRequestToLGW(ctx context.Context) bool
- func Decode(input interface{}, output interface{}) error
- func EnableMesh() bool
- func ErrorWrapper(body []byte, extra map[string]interface{}, err error) ([]byte, error)
- func GetAGWDomain(ctx context.Context) string
- func GetAGWDomainByConf(ctx context.Context) string
- func GetAPaaSLaneFromCtx(ctx context.Context) string
- func GetAPaaSPersistFaaSMapFromCtx(ctx context.Context) (copyRes map[string]string)
- func GetAPaaSPersistFaaSMapStr(ctx context.Context) string
- func GetAPaaSPersistFaaSValueFromCtx(ctx context.Context, key string) string
- func GetApiTimeoutFromCtx(ctx context.Context) map[string]int64
- func GetAppIDAndSecret() (string, string, error)
- func GetAppInfoFromCtx(ctx context.Context) (*structs.AppInfo, error)
- func GetBoe(ctx context.Context) string
- func GetCurFunctionMetaConfFromCtx(ctx context.Context) *structs.FunctionMeta
- func GetDebugTypeFromCtx(ctx context.Context) int
- func GetDistributedMaskFromCtx(ctx context.Context) string
- func GetEnv() string
- func GetEnvBoeFromCtx(ctx context.Context) string
- func GetEnvOrgID() string
- func GetEventInfoFromCtx(ctx context.Context) (*structs.EventInfo, error)
- func GetFaaSEnvIDFromCtx(ctx context.Context) string
- func GetFaaSEnvTypeFromCtx(ctx context.Context) int64
- func GetFaaSInfraDomain(ctx context.Context) string
- func GetFaaSInfraDomainName() string
- func GetFaaSInfraPSM(ctx context.Context) string
- func GetFaaSInfraPSMFromEnv() (psm string, cluster string)
- func GetFaaSLaneIDFromCtx(ctx context.Context) string
- func GetFaaSPlatform() string
- func GetFaaSType(ctx context.Context) string
- func GetFuncAPINameFromCtx(ctx context.Context) string
- func GetFunctionMetaConfFromCtx(ctx context.Context, apiName string) *structs.FunctionMeta
- func GetFunctionNameFromCtx(ctx context.Context) string
- func GetGlobalAuthType() *string
- func GetInnerAPIPSM(ctx context.Context) string
- func GetInnerAPIPSMFromCtx(ctx context.Context) string
- func GetInnerAPIPSMFromEnv() string
- func GetLGWClusterFromEnv() string
- func GetLGWPSMFromEnv() string
- func GetLogIDFromCtx(ctx context.Context) string
- func GetLogIDFromExtra(extra map[string]interface{}) string
- func GetLoopMaskFromCtx(ctx context.Context) []string
- func GetNamespace() string
- func GetNamespaceFromCtx(ctx context.Context) string
- func GetOpenAPIDomain(ctx context.Context) string
- func GetOpenAPIDomainByConf(ctx context.Context) string
- func GetOpenAPIDomainName() string
- func GetOpenAPIPSMAndCluster(ctx context.Context) (psm string, cluster string)
- func GetParamUnauthFieldByKey(ctx context.Context, key string) (unauthFields interface{})
- func GetParamUnauthFieldMapFromCtx(ctx context.Context) (keyToUnauthFields map[string]interface{})
- func GetParamUnauthFieldRecordByKey(ctx context.Context, key string) (unauthFields []string)
- func GetParamUnauthFieldRecordListByKey(ctx context.Context, key string) (unauthFieldsList [][]string)
- func GetRecordID(record interface{}) int64
- func GetRecordUnauthFieldByObject(ctx context.Context, objectAPIName string) (recordIDToUnauthFields map[int64][]string)
- func GetRecordUnauthFieldByObjectAndRecordID(ctx context.Context, objectAPIName string, recordID int64) (unauthFields []string)
- func GetSDKConf(ctx context.Context) *structs.SDKConf
- func GetSDKTransientConf(ctx context.Context) *structs.SDKTransientConf
- func GetServiceID() string
- func GetSocketAddr() string
- func GetSourceTypeFromCtx(ctx context.Context) int
- func GetTTEnvFromCtx(ctx context.Context) string
- func GetTenantFromCtx(ctx context.Context) (*structs.Tenant, error)
- func GetTenantIDFromCtx(ctx context.Context) int64
- func GetTenantName() string
- func GetTraceHeader(ctx context.Context) map[string]string
- func GetTriggerTaskIDFromCtx(ctx context.Context) int64
- func GetTriggerTypeFromCtx(ctx context.Context) string
- func GetUserContext(ctx context.Context) (res structs.UserContext)
- func GetUserContextMap(ctx context.Context) (res map[string]interface{})
- func GetUserIDFromCtx(ctx context.Context) int64
- func Int64InInt64s(ns []int, n int) bool
- func Int64Ptr(val int64) *int64
- func Int64ValueOfPtr(p *int64, defaultVal int64) int64
- func IntInInts(ns []int, n int) bool
- func IntPtr(val int) *int
- func IntValueOfPtr(p *int, defaultVal int) int
- func InvokeFuncWithRetry(retryCount int, retryInterval time.Duration, f func() error) error
- func IsCloseMesh(ctx context.Context) bool
- func IsDebug(ctx context.Context) bool
- func IsExternalFaaS() bool
- func IsLocalDebug(ctx context.Context) bool
- func IsMicroservice(ctx context.Context) bool
- func IsRuntime(ctx context.Context) bool
- func IsTmpUseOpenapi(ctx context.Context) bool
- func IsTrueString(str string) bool
- func JsonMarshalBytes(val interface{}) ([]byte, error)
- func JsonUnmarshalBytes(val []byte, addr interface{}) error
- func LevelInfo(level logrus.Level) (string, int)
- func NowMils() int64
- func OpenMesh(ctx context.Context) bool
- func ParseStrList(v interface{}) (strs []string)
- func ParseStrsList(v interface{}) (strsList [][]string)
- func PrintLog(contents ...interface{})
- func PtrToInt(p *int, defaultVal int) int
- func SetAPaaSLaneToCtx(ctx context.Context, lane string) context.Context
- func SetAPaaSPersistFaaSMapToCtx(ctx context.Context, aPaaSPersistFaaSMap map[string]string) context.Context
- func SetApiTimeoutMethodToCtx(ctx context.Context, method string) context.Context
- func SetApiTimeoutToCtx(ctx context.Context, timeout map[string]int64) context.Context
- func SetAppInfoToCtx(ctx context.Context, appInfo *structs.AppInfo) context.Context
- func SetDebugTypeToCtx(ctx context.Context, debugType int) context.Context
- func SetDistributedMaskToCtx(ctx context.Context, mask string) context.Context
- func SetEnvBoeToCtx(ctx context.Context, boe string) context.Context
- func SetEventInfoToCtx(ctx context.Context, appInfo *structs.EventInfo) context.Context
- func SetFaaSEnvIDCtx(ctx context.Context, envID string) context.Context
- func SetFaaSEnvTypeCtx(ctx context.Context, envType int64) context.Context
- func SetFaaSLaneIDCtx(ctx context.Context, laneID string) context.Context
- func SetFuncAPINameToCtx(ctx context.Context, funcAPIName string) context.Context
- func SetFunctionMetaConfToCtx(ctx context.Context, metaConf map[string]string) context.Context
- func SetFunctionNameToCtx(ctx context.Context, functionName string) context.Context
- func SetInnerAPIPSMToCtx(ctx context.Context, psm string) context.Context
- func SetKEnvToCtx(ctx context.Context, kEnv string) context.Context
- func SetKEnvToCtxForRPC(ctx context.Context) context.Context
- func SetLogIDToCtx(ctx context.Context, logID string) context.Context
- func SetLoopMaskToCtx(ctx context.Context, mask []string) context.Context
- func SetRecordUnauthField(ctx context.Context, unauthFieldMap RecordUnauthField) context.Context
- func SetRuntimeType(ctx context.Context, runtimeType string) context.Context
- func SetSourceTypeToCtx(ctx context.Context, sourceType int) context.Context
- func SetTTEnvToCtx(ctx context.Context, ttEnv string) context.Context
- func SetTenantToCtx(ctx context.Context, tenant *structs.Tenant) context.Context
- func SetTmpUseOpenapiToCtx(ctx context.Context) context.Context
- func SetTriggerTaskIDToCtx(ctx context.Context, taskID int64) context.Context
- func SetTriggerTypeToCtx(ctx context.Context, triggerType string) context.Context
- func SetUserAndAuthTypeToCtx(ctx context.Context, authType *string) context.Context
- func SetUserAndAuthTypeToHeaders(ctx context.Context, headers map[string][]string) map[string][]string
- func SetUserAndMixAuthTypeToCtx(ctx context.Context, authType *string, isMix bool) context.Context
- func SetUserAndMixAuthTypeToHeaders(ctx context.Context, headers map[string][]string, isMix bool) map[string][]string
- func SetUserContext(ctx context.Context, userCtx structs.UserContext) context.Context
- func SetUserContextMap(ctx context.Context, userCtxMap map[string]interface{}) context.Context
- func SetUserIDToCtx(ctx context.Context, userID int64) context.Context
- func StrInStrs(strs []string, str string) bool
- func StringPtr(val string) *string
- func StringValueOfPtr(p *string, defaultVal string) string
- func TimeMils(t time.Time) int64
- func ToString(v interface{}) string
- func WebIDELevelInfo(level logrus.Level) string
- func WithAPaaSPersistFaaSValue(ctx context.Context, key, value string) context.Context
- func WriteUnauthFieldMapWithLock(ctx context.Context, objectAPIName string, recordID int64, ...)
- type ConsoleLogger
- type LogFormatter
- type PathReplace
- func (p *PathReplace) APIName(APIName string) *PathReplace
- func (p *PathReplace) ExecutionID(instanceID int64) *PathReplace
- func (p *PathReplace) FieldAPIName(fieldAPIName string) *PathReplace
- func (p *PathReplace) FileID(fileID string) *PathReplace
- func (p *PathReplace) FunctionAPIName(functionAPIName string) *PathReplace
- func (p *PathReplace) Namespace(namespace string) *PathReplace
- func (p *PathReplace) ObjectAPIName(objectAPIName string) *PathReplace
- func (p *PathReplace) Path() string
- func (p *PathReplace) RecordID(recordID int64) *PathReplace
- type RecordUnauthField
- type RuntimeType
- type UseOpenapiKey
- type WebIDELogFormatter
Constants ¶
View Source
const ( // Log Type Console = "Console" System = "System" Result = "Result" WebIDESource = "apaas-ide" ISWebIDE = "IS_WEB_IDE" )
Variables ¶
This section is empty.
Functions ¶
func AesDecryptText ¶
func BoolValueOfPtr ¶
func CanOpenAPIRequestToLGW ¶ added in v0.0.23
CanOpenAPIRequestToLGW Whether OpenAPI requests can be routed to LGW
func ErrorWrapper ¶ added in v0.0.22
func GetAGWDomain ¶
func GetAGWDomainByConf ¶
func GetAPaaSLaneFromCtx ¶ added in v0.0.4
func GetAPaaSPersistFaaSMapFromCtx ¶ added in v0.0.4
func GetAPaaSPersistFaaSMapStr ¶ added in v0.0.4
func GetAPaaSPersistFaaSValueFromCtx ¶ added in v0.0.4
func GetAppIDAndSecret ¶
func GetAppInfoFromCtx ¶ added in v0.0.8
func GetCurFunctionMetaConfFromCtx ¶ added in v0.0.19
func GetCurFunctionMetaConfFromCtx(ctx context.Context) *structs.FunctionMeta
func GetDebugTypeFromCtx ¶
func GetEnvBoeFromCtx ¶
func GetEnvOrgID ¶
func GetEnvOrgID() string
func GetEventInfoFromCtx ¶ added in v0.0.8
func GetFaaSEnvIDFromCtx ¶ added in v0.0.23
func GetFaaSEnvTypeFromCtx ¶ added in v0.0.23
GetEnvTypeFromCtx
func GetFaaSInfraDomain ¶
func GetFaaSInfraDomainName ¶ added in v0.0.23
func GetFaaSInfraDomainName() string
func GetFaaSInfraPSMFromEnv ¶ added in v0.0.23
func GetFaaSLaneIDFromCtx ¶ added in v0.0.20
func GetFaaSPlatform ¶ added in v0.0.23
func GetFaaSPlatform() string
func GetFaaSType ¶ added in v0.0.4
func GetFuncAPINameFromCtx ¶ added in v0.0.19
func GetFunctionMetaConfFromCtx ¶ added in v0.0.19
func GetFunctionMetaConfFromCtx(ctx context.Context, apiName string) *structs.FunctionMeta
func GetFunctionNameFromCtx ¶
func GetGlobalAuthType ¶ added in v0.0.21
func GetGlobalAuthType() *string
GetGlobalAuthType 全局鉴权类型配置,优先级低于接口级
func GetInnerAPIPSM ¶
GetInnerAPIPSM open-sdk: from ctx faaS-sdk: from const by env Deprecated
func GetInnerAPIPSMFromCtx ¶
func GetInnerAPIPSMFromEnv ¶ added in v0.0.23
func GetInnerAPIPSMFromEnv() string
func GetLGWClusterFromEnv ¶ added in v0.0.23
func GetLGWClusterFromEnv() string
func GetLGWPSMFromEnv ¶ added in v0.0.23
func GetLGWPSMFromEnv() string
func GetLogIDFromCtx ¶
func GetLogIDFromExtra ¶
func GetLoopMaskFromCtx ¶
func GetNamespace ¶
func GetNamespace() string
func GetNamespaceFromCtx ¶
func GetOpenAPIDomain ¶
func GetOpenAPIDomainByConf ¶ added in v0.0.23
func GetOpenAPIDomainName ¶ added in v0.0.23
func GetOpenAPIDomainName() string
func GetOpenAPIPSMAndCluster ¶ added in v0.0.23
func GetParamUnauthFieldByKey ¶ added in v0.0.19
func GetParamUnauthFieldMapFromCtx ¶ added in v0.0.19
参数对应的无权限字段
func GetParamUnauthFieldRecordByKey ¶ added in v0.0.19
func GetParamUnauthFieldRecordListByKey ¶ added in v0.0.19
func GetRecordID ¶ added in v0.0.19
func GetRecordID(record interface{}) int64
func GetRecordUnauthFieldByObject ¶ added in v0.0.19
func GetRecordUnauthFieldByObjectAndRecordID ¶ added in v0.0.19
func GetSDKTransientConf ¶ added in v0.0.23
func GetSDKTransientConf(ctx context.Context) *structs.SDKTransientConf
func GetServiceID ¶
func GetServiceID() string
func GetSocketAddr ¶ added in v0.0.23
func GetSocketAddr() string
func GetSourceTypeFromCtx ¶
func GetTTEnvFromCtx ¶
func GetTenantIDFromCtx ¶
func GetTenantName ¶
func GetTenantName() string
func GetTriggerTaskIDFromCtx ¶
func GetTriggerTypeFromCtx ¶
func GetUserContext ¶
func GetUserContext(ctx context.Context) (res structs.UserContext)
func GetUserContextMap ¶ added in v0.0.2
func GetUserIDFromCtx ¶
func Int64InInt64s ¶
func Int64ValueOfPtr ¶
func IntValueOfPtr ¶
func InvokeFuncWithRetry ¶
func IsCloseMesh ¶ added in v0.0.23
func IsExternalFaaS ¶ added in v0.0.23
func IsExternalFaaS() bool
func IsLocalDebug ¶
func IsMicroservice ¶ added in v0.0.4
func IsTmpUseOpenapi ¶ added in v0.0.23
func IsTrueString ¶ added in v0.0.23
func JsonMarshalBytes ¶
func JsonUnmarshalBytes ¶
func ParseStrList ¶ added in v0.0.19
func ParseStrList(v interface{}) (strs []string)
func ParseStrsList ¶ added in v0.0.19
func ParseStrsList(v interface{}) (strsList [][]string)
func SetAPaaSLaneToCtx ¶ added in v0.0.4
func SetAPaaSPersistFaaSMapToCtx ¶ added in v0.0.4
func SetApiTimeoutToCtx ¶
func SetAppInfoToCtx ¶ added in v0.0.8
func SetDistributedMaskToCtx ¶
func SetEventInfoToCtx ¶ added in v0.0.8
func SetFaaSEnvIDCtx ¶ added in v0.0.23
func SetFaaSEnvTypeCtx ¶ added in v0.0.23
func SetFaaSLaneIDCtx ¶ added in v0.0.20
func SetFuncAPINameToCtx ¶ added in v0.0.19
func SetFunctionMetaConfToCtx ¶ added in v0.0.19
SetFunctionMetaConfToCtx 提供给框架层使用
func SetFunctionNameToCtx ¶
func SetInnerAPIPSMToCtx ¶
func SetRecordUnauthField ¶ added in v0.0.19
func SetRecordUnauthField(ctx context.Context, unauthFieldMap RecordUnauthField) context.Context
func SetRuntimeType ¶ added in v0.0.23
func SetSourceTypeToCtx ¶
func SetTenantToCtx ¶
func SetTmpUseOpenapiToCtx ¶ added in v0.0.23
func SetTriggerTaskIDToCtx ¶
func SetTriggerTypeToCtx ¶
func SetUserAndAuthTypeToCtx ¶ added in v0.0.5
func SetUserAndAuthTypeToHeaders ¶ added in v0.0.5
func SetUserAndMixAuthTypeToCtx ¶ added in v0.0.19
SetUserAndMixAuthTypeToCtx 设置鉴权方式 - 接口级配置优先级高于函数级 - 函数级配置 - oql 接口使用 system 和 mix_user_system - 除 oql 之外的接口使用 system 和 user
func SetUserAndMixAuthTypeToHeaders ¶ added in v0.0.19
func SetUserContext ¶
func SetUserContextMap ¶ added in v0.0.2
func StringValueOfPtr ¶
func WebIDELevelInfo ¶ added in v0.0.7
func WithAPaaSPersistFaaSValue ¶ added in v0.0.4
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
// contains filtered or unexported fields
}
func GetConsoleLogger ¶
func GetConsoleLogger(logIDs ...string) *ConsoleLogger
func (*ConsoleLogger) Errorf ¶
func (c *ConsoleLogger) Errorf(format string, args ...interface{})
func (*ConsoleLogger) Infof ¶
func (c *ConsoleLogger) Infof(format string, args ...interface{})
func (*ConsoleLogger) Result ¶
func (c *ConsoleLogger) Result(format string, args ...interface{})
func (*ConsoleLogger) Warnf ¶
func (c *ConsoleLogger) Warnf(format string, args ...interface{})
type LogFormatter ¶
type LogFormatter struct { }
type PathReplace ¶
type PathReplace struct {
// contains filtered or unexported fields
}
PathReplace 路径替换工具
func NewPathReplace ¶
func NewPathReplace(path string) *PathReplace
func (*PathReplace) APIName ¶
func (p *PathReplace) APIName(APIName string) *PathReplace
func (*PathReplace) ExecutionID ¶
func (p *PathReplace) ExecutionID(instanceID int64) *PathReplace
func (*PathReplace) FieldAPIName ¶
func (p *PathReplace) FieldAPIName(fieldAPIName string) *PathReplace
func (*PathReplace) FileID ¶
func (p *PathReplace) FileID(fileID string) *PathReplace
func (*PathReplace) FunctionAPIName ¶
func (p *PathReplace) FunctionAPIName(functionAPIName string) *PathReplace
func (*PathReplace) Namespace ¶
func (p *PathReplace) Namespace(namespace string) *PathReplace
func (*PathReplace) ObjectAPIName ¶
func (p *PathReplace) ObjectAPIName(objectAPIName string) *PathReplace
func (*PathReplace) Path ¶
func (p *PathReplace) Path() string
func (*PathReplace) RecordID ¶
func (p *PathReplace) RecordID(recordID int64) *PathReplace
type RecordUnauthField ¶ added in v0.0.19
RecordUnauthField 记录对应的无权限字段
func GetRecordUnauthField ¶ added in v0.0.19
func GetRecordUnauthField(ctx context.Context) (objToRecordIDToUnauthFields RecordUnauthField)
type RuntimeType ¶ added in v0.0.23
type RuntimeType string
const ( RuntimeTypeRuntime RuntimeType = "0" // 运行态 RuntimeTypeCloudDebug RuntimeType = "1" // 云端调试 RuntimeTypeLocalDebug RuntimeType = "2" // 本地调试 )
func GetRuntimeType ¶ added in v0.0.23
func GetRuntimeType(ctx context.Context) RuntimeType
type UseOpenapiKey ¶ added in v0.0.23
type UseOpenapiKey string
type WebIDELogFormatter ¶ added in v0.0.7
type WebIDELogFormatter struct { }
Click to show internal directories.
Click to hide internal directories.