Merge branch 'master' of ssh://gitea.digitalcircle.com.br:2222/open/replaycli-go

master
Leonardo Domingues 2021-11-25 10:50:42 -03:00
commit 59f6b2578a
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package apiproxy
import "go.digitalcircle.com.br/open/replaycli-go/api"
type APIProxyRequest struct {
Name string `json:"name,omitempty"`
Method string `json:"method,omitempty"`
Url string `json:"url,omitempty"`
Header map[string]string `json:"header,omitempty"`
Body []byte `json:"body,omitempty"`
Readonly bool `json:"readonly"`
}
type APIProxyResponse struct {
Status string `json:"status"`
StatusCode int `json:"status_code"`
Header map[string]string `json:"header,omitempty"`
Body []byte `json:"body,omitempty"`
}
type Cli struct {
*api.ApiCli
}
func (c *Cli) Do(req *APIProxyRequest) (*APIProxyResponse, error) {
res := &APIProxyResponse{}
err := c.HttpCli().JsonPost("/ipc/apiproxy/do", req, res)
return res, err
}
func NewCli() *Cli {
ret := &Cli{ApiCli: api.NewApiCli()}
return ret
}