test(files, users): add e2e test and fix issues

This commit is contained in:
hexxa 2020-12-10 22:22:38 +08:00
parent b065684a47
commit 0265baf1b1
15 changed files with 5015 additions and 5327 deletions

30
src/client/settings.go Normal file
View file

@ -0,0 +1,30 @@
package client
import (
"fmt"
"net/http"
"github.com/parnurzeal/gorequest"
)
type SettingsClient struct {
addr string
r *gorequest.SuperAgent
}
func NewSettingsClient(addr string) *SettingsClient {
gr := gorequest.New()
return &SettingsClient{
addr: addr,
r: gr,
}
}
func (cl *SettingsClient) url(urlpath string) string {
return fmt.Sprintf("%s%s", cl.addr, urlpath)
}
func (cl *SettingsClient) Health() (*http.Response, string, []error) {
return cl.r.Options(cl.url("/v1/settings/health")).
End()
}