Documentation ¶
Index ¶
- func BasicAuth(username, password string) string
- func ConsumeRestJSON[Resp ApiResp](c *CallData) (*Resp, response.ErrorState)
- func GetJSONResp[Resp ApiResp](api RemoteApi, resp *http.Response) (*Resp, response.ErrorState)
- func PrepareCall(c CallData) (*http.Request, response.ErrorState)
- func RemoteCall[Req any, Resp ApiResp](param *RemoteCallParamData[Req]) (*Resp, response.ErrorState)
- func TransmitRequestWithAuth(path, api, method string, requestByte []byte, headers map[string]string, ...) (int, map[string]string, any, error)
- func TransmitSoap[Resp any](request any, url string, debug bool, timeout time.Duration) (*Resp, error)
- type ApiResp
- type CallApiInterface
- type CallData
- type CallParam
- type CallParamData
- type CallResp
- type CallResult
- type RemoteApi
- type RemoteApiModel
- func (m RemoteApiModel) ConsumeRestApi(requestJson []byte, apiName, path, contentType, method string, ...) ([]byte, string, int, error)
- func (m RemoteApiModel) ConsumeRestBasicAuthApi(requestJson []byte, apiName, path, contentType, method string, ...) ([]byte, string, error)
- func (m RemoteApiModel) GetApi(apiName string) RemoteApi
- type RemoteCallParamData
- type TypeList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumeRestJSON ¶ added in v0.9.52
func ConsumeRestJSON[Resp ApiResp](c *CallData) (*Resp, response.ErrorState)
func GetJSONResp ¶ added in v0.9.52
func PrepareCall ¶
func PrepareCall(c CallData) (*http.Request, response.ErrorState)
func RemoteCall ¶ added in v0.9.52
func RemoteCall[Req any, Resp ApiResp](param *RemoteCallParamData[Req]) (*Resp, response.ErrorState)
func TransmitRequestWithAuth ¶
func TransmitRequestWithAuth( path, api, method string, requestByte []byte, headers map[string]string, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), consumeHandler func([]byte, string, string, string, string, map[string]string) ([]byte, string, int, error), ) (int, map[string]string, any, error)
Types ¶
type CallApiInterface ¶
type CallApiInterface interface { GetApi(apiName string) RemoteApi ConsumeRestBasicAuthApi(requestJson []byte, apiName, path, contentType, method string, headers map[string]string) ([]byte, string, error) ConsumeRestApi(requestJson []byte, apiName, path, contentType, method string, headers map[string]string) ([]byte, string, int, error) }
type CallData ¶
type CallParam ¶ added in v0.3.4
type CallParam *CallParamData
type CallParamData ¶ added in v0.9.16
type CallResp ¶
func ConsumeRest ¶
func ConsumeRest[Resp any](c CallData) (*Resp, *response.WsRemoteResponse, *CallResp, response.ErrorState)
type CallResult ¶ added in v0.3.4
type CallResult[RespType any] struct { Resp *RespType WsResp *response.WsRemoteResponse Status *CallResp Error response.ErrorState }
func Call ¶ added in v0.3.4
func Call[RespType any](param CallParam) CallResult[RespType]
func MultiCall ¶ added in v0.3.6
func MultiCall(paramList []CallParam, core CallApiInterface) []CallResult[response.WsRemoteResponse]
type RemoteApiModel ¶
func (RemoteApiModel) ConsumeRestApi ¶
func (RemoteApiModel) ConsumeRestBasicAuthApi ¶
func (RemoteApiModel) GetApi ¶
func (m RemoteApiModel) GetApi(apiName string) RemoteApi
type RemoteCallParamData ¶ added in v0.9.52
Click to show internal directories.
Click to hide internal directories.