Documentation ¶
Index ¶
- func AddJsonBodyTenantIDAndUserID(c *api.Context, tenantIDField string, userIDField string) (map[string]any, error)
- func AddQueryParamsTenantIDAndUserID(c *api.Context, tenantIDField string, userIDField string) (map[string]string, error)
- func DestroyGateway(gw *Gateway)
- type Builder
- func (builder *Builder) Build(middlewares ...api.Handler)
- func (builder *Builder) Delete(request *DeleteRequest, requestCallbackFunc RequestResponseCallback) *Builder
- func (builder *Builder) Get(request *GetRequest, requestCallbackFunc RequestResponseCallback) *Builder
- func (builder *Builder) GlobalRequestCallback(globalRequestResponseCallback GlobalRequestResponseCallback) *Builder
- func (builder *Builder) Post(request *PostRequest, requestCallbackFunc RequestResponseCallback) *Builder
- func (builder *Builder) Put(request *PutRequest, requestCallbackFunc RequestResponseCallback) *Builder
- func (builder *Builder) Request(formBuilderRequestFunc FormBuilderRequestFunc, ...) *Builder
- func (builder *Builder) ResponseErrorCallback(responseErrorCallback ResponseErrorCallback) *Builder
- func (builder *Builder) ResponseSuccessCallback(responseSuccessCallback ResponseSuccessCallback) *Builder
- func (builder *Builder) Url(httpMethod string, relativePath string) *Builder
- type BuilderRequest
- type DeleteRequest
- type FormBuilderRequestFunc
- type Gateway
- type GetRequest
- type GlobalRequestResponseCallback
- type Option
- type Options
- type PostRequest
- type PutRequest
- type RequestResponseCallback
- type ResponseErrorCallback
- type ResponseSuccessCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJsonBodyTenantIDAndUserID ¶ added in v0.4.0
func AddQueryParamsTenantIDAndUserID ¶ added in v0.4.0
func DestroyGateway ¶
func DestroyGateway(gw *Gateway)
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) Delete ¶
func (builder *Builder) Delete(request *DeleteRequest, requestCallbackFunc RequestResponseCallback) *Builder
func (*Builder) Get ¶
func (builder *Builder) Get(request *GetRequest, requestCallbackFunc RequestResponseCallback) *Builder
func (*Builder) GlobalRequestCallback ¶ added in v0.4.0
func (builder *Builder) GlobalRequestCallback(globalRequestResponseCallback GlobalRequestResponseCallback) *Builder
func (*Builder) Post ¶
func (builder *Builder) Post(request *PostRequest, requestCallbackFunc RequestResponseCallback) *Builder
func (*Builder) Put ¶
func (builder *Builder) Put(request *PutRequest, requestCallbackFunc RequestResponseCallback) *Builder
func (*Builder) Request ¶ added in v0.4.0
func (builder *Builder) Request(formBuilderRequestFunc FormBuilderRequestFunc, requestCallbackFunc RequestResponseCallback) *Builder
func (*Builder) ResponseErrorCallback ¶ added in v0.4.0
func (builder *Builder) ResponseErrorCallback(responseErrorCallback ResponseErrorCallback) *Builder
func (*Builder) ResponseSuccessCallback ¶ added in v0.4.0
func (builder *Builder) ResponseSuccessCallback(responseSuccessCallback ResponseSuccessCallback) *Builder
type BuilderRequest ¶
type BuilderRequest interface { HttpMethod() string Request(request *http_client.Request) error Response() *http_client.Response }
type DeleteRequest ¶
type DeleteRequest struct { Url string Headers map[string]string PathParams map[string]string QueryParams map[string]string // contains filtered or unexported fields }
func (*DeleteRequest) HttpMethod ¶
func (req *DeleteRequest) HttpMethod() string
func (*DeleteRequest) Request ¶
func (req *DeleteRequest) Request(request *http_client.Request) error
func (*DeleteRequest) Response ¶
func (req *DeleteRequest) Response() *http_client.Response
type FormBuilderRequestFunc ¶ added in v0.4.0
type FormBuilderRequestFunc func(c *api.Context, historyRequests []BuilderRequest, resultMap map[string]any) (BuilderRequest, error)
type GetRequest ¶
type GetRequest struct { Url string Headers map[string]string PathParams map[string]string QueryParams map[string]string // contains filtered or unexported fields }
func (*GetRequest) HttpMethod ¶
func (req *GetRequest) HttpMethod() string
func (*GetRequest) Request ¶
func (req *GetRequest) Request(request *http_client.Request) error
func (*GetRequest) RequestUrl ¶
func (req *GetRequest) RequestUrl() string
func (*GetRequest) Response ¶
func (req *GetRequest) Response() *http_client.Response
type GlobalRequestResponseCallback ¶ added in v0.4.0
type GlobalRequestResponseCallback func(c *api.Context, request BuilderRequest, historyRequests []BuilderRequest, resultMap map[string]any) error
type PostRequest ¶
type PostRequest struct { Url string Headers map[string]string Body any // contains filtered or unexported fields }
func (*PostRequest) HttpMethod ¶
func (req *PostRequest) HttpMethod() string
func (*PostRequest) Request ¶
func (req *PostRequest) Request(request *http_client.Request) error
func (*PostRequest) RequestUrl ¶
func (req *PostRequest) RequestUrl() string
func (*PostRequest) Response ¶
func (req *PostRequest) Response() *http_client.Response
type PutRequest ¶
type PutRequest struct { // 静态配置 Url string Headers map[string]string Body any // contains filtered or unexported fields }
func (*PutRequest) HttpMethod ¶
func (req *PutRequest) HttpMethod() string
func (*PutRequest) Request ¶
func (req *PutRequest) Request(request *http_client.Request) error
func (*PutRequest) RequestUrl ¶
func (req *PutRequest) RequestUrl() string
func (*PutRequest) Response ¶
func (req *PutRequest) Response() *http_client.Response
type RequestResponseCallback ¶ added in v0.4.0
type RequestResponseCallback func(c *api.Context, response *http_client.Response, historyRequests []BuilderRequest, resultMap map[string]any) error
type ResponseErrorCallback ¶ added in v0.4.0
type ResponseSuccessCallback ¶ added in v0.4.0
type ResponseSuccessCallback func(c *api.Context, historyRequests []BuilderRequest, resultMap map[string]any)
Click to show internal directories.
Click to hide internal directories.