Documentation ¶
Index ¶
- Constants
- func AppTokenMiddleware(ctx context.Context, req *http.Request) (err error)
- func AppendParamsUnauthFields(ctx context.Context, funcAPIName string, inputOrOutput string, ...) (context.Context, error)
- func AppendUnauthFieldRecord(ctx context.Context, objectAPIName string, recordOrID interface{}, ...)
- func AppendUnauthFieldRecordList(ctx context.Context, objectAPIName string, records interface{}, ...)
- func CalcParamsNeedPermission(ctx context.Context, funcAPIName string, inputOrOutput string, ...) *structs.Permission
- func GetAppTokenHttp(ctx context.Context, clientID, clientSecret string) (*structs.AppTokenResp, error)
- func GetFaaSInfraPathSendLog() string
- func GetFunctionMetaConfWithCache(ctx context.Context, apiName string) *structs.FunctionMeta
- func GetFunctionMetaFromRemote(ctx context.Context, apiName string) (functionMeta *structs.FunctionMeta, err error)
- func GetFunctionMetaHttp(ctx context.Context, apiName string) (funcMeta *structs.FunctionMeta, err error)
- func GetInnerAPIPathGetFunction() string
- func GetTimeoutCtx(ctx context.Context) (context.Context, context.CancelFunc)
- func SendLog(ctx context.Context, data interface{}) error
- func ServiceIDMiddleware(ctx context.Context, req *http.Request) error
- func SetCredentialToCtx(ctx context.Context, credential *AppCredential) context.Context
- func TenantAndUserMiddleware(ctx context.Context, req *http.Request) error
- func TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(ctx context.Context, net, addr string) (c net.Conn, err error)
- type AppCredential
- type ClientType
- type HttpClient
- func (c *HttpClient) DeleteJson(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- func (c *HttpClient) Get(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- func (c *HttpClient) PatchJson(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- func (c *HttpClient) PostBson(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- func (c *HttpClient) PostFormData(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- func (c *HttpClient) PostJson(ctx context.Context, path string, headers map[string][]string, ...) ([]byte, map[string]interface{}, error)
- type ICredential
- type ReqMiddleWare
Constants ¶
View Source
const ( OpenapiPathGetToken = "/auth/v1/appToken" FaaSInfraPathSendLog = "/log/v1/namespaces/:namespace/logs/batchSend" InnerAPIGetFunction = "/cloudfunction/v1/namespaces/:namespace/functions/detail" )
Variables ¶
This section is empty.
Functions ¶
func AppTokenMiddleware ¶
func AppendParamsUnauthFields ¶ added in v0.0.19
func AppendParamsUnauthFields(ctx context.Context, funcAPIName string, inputOrOutput string, params interface{}, unauthFieldsMap map[string]interface{}) (context.Context, error)
AppendParamsUnauthFields 处理参数中的权限 提取权限信息
func AppendUnauthFieldRecord ¶ added in v0.0.19
func AppendUnauthFieldRecordList ¶ added in v0.0.19
func CalcParamsNeedPermission ¶ added in v0.0.19
func CalcParamsNeedPermission(ctx context.Context, funcAPIName string, inputOrOutput string, params interface{}) *structs.Permission
CalcParamsNeedPermission 计算参数需要的权限,返回权限信息
func GetAppTokenHttp ¶
func GetFaaSInfraPathSendLog ¶
func GetFaaSInfraPathSendLog() string
func GetFunctionMetaConfWithCache ¶ added in v0.0.19
func GetFunctionMetaConfWithCache(ctx context.Context, apiName string) *structs.FunctionMeta
func GetFunctionMetaFromRemote ¶ added in v0.0.19
func GetFunctionMetaHttp ¶ added in v0.0.19
func GetInnerAPIPathGetFunction ¶ added in v0.0.19
func GetInnerAPIPathGetFunction() string
func GetTimeoutCtx ¶
func SetCredentialToCtx ¶
func SetCredentialToCtx(ctx context.Context, credential *AppCredential) context.Context
func TenantAndUserMiddleware ¶
Types ¶
type AppCredential ¶
type AppCredential struct {
// contains filtered or unexported fields
}
func NewAppCredential ¶
func NewAppCredential(id, secret string) *AppCredential
func (*AppCredential) GetID ¶ added in v0.0.38
func (c *AppCredential) GetID() string
func (*AppCredential) GetTenantInfo ¶
type HttpClient ¶
type HttpClient struct { Type ClientType http.Client MeshClient *http.Client FromSDK version.ISDKInfo }
func GetFaaSInfraClient ¶
func GetFaaSInfraClient(ctx context.Context) *HttpClient
func GetOpenapiClient ¶
func GetOpenapiClient() *HttpClient
func (*HttpClient) DeleteJson ¶
func (c *HttpClient) DeleteJson(ctx context.Context, path string, headers map[string][]string, data interface{}, midList ...ReqMiddleWare) ([]byte, map[string]interface{}, error)
func (*HttpClient) Get ¶
func (c *HttpClient) Get(ctx context.Context, path string, headers map[string][]string, midList ...ReqMiddleWare) ([]byte, map[string]interface{}, error)
func (*HttpClient) PatchJson ¶
func (c *HttpClient) PatchJson(ctx context.Context, path string, headers map[string][]string, data interface{}, midList ...ReqMiddleWare) ([]byte, map[string]interface{}, error)
func (*HttpClient) PostBson ¶
func (c *HttpClient) PostBson(ctx context.Context, path string, headers map[string][]string, data interface{}, midList ...ReqMiddleWare) ([]byte, map[string]interface{}, error)
func (*HttpClient) PostFormData ¶
type ICredential ¶
type ICredential interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.