saastool增加docker/daemon模式

This commit is contained in:
algotao
2025-09-24 18:38:03 +08:00
parent a88c5c6e3f
commit d7ab7b5156
14 changed files with 1023 additions and 120 deletions

View File

@@ -17,6 +17,8 @@ const (
bindSetPath = "/saas/bind/set"
bindDeletePath = "/saas/bind/delete"
scriptRunPath = "/saas/script/run"
expListPath = "/saas/exp/list"
expGetPath = "/saas/exp/get"
)
type ApiUrls struct {
@@ -36,6 +38,8 @@ type ApiUrls struct {
BindSetPath string
BindDeletePath string
ScriptRunPath string
ExpListPath string
ExpGetPath string
}
func InitAPIUrl(c *ApiUrls) *ApiUrls {
@@ -136,6 +140,18 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
r.ScriptRunPath = scriptRunPath
}
if c.ExpListPath != "" {
r.ExpListPath = c.ExpListPath
} else {
r.ExpListPath = expListPath
}
if c.ExpGetPath != "" {
r.ExpGetPath = c.ExpGetPath
} else {
r.ExpGetPath = expGetPath
}
return r
}

View File

@@ -108,6 +108,16 @@ func (c *SaasClient) ScriptRun(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasR
return c.post(postUrl, saasReq)
}
func (c *SaasClient) ExpList(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ExpListPath)
return c.post(postUrl, saasReq)
}
func (c *SaasClient) ExpGet(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ExpGetPath)
return c.post(postUrl, saasReq)
}
func (c *SaasClient) makeUrl(baseUrl, path string, params ...string) string {
url, err := url.Parse(baseUrl)
if err != nil {