aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-02-04 15:06:34 +0700
committerShulhan <ms@kilabit.info>2024-02-04 15:06:46 +0700
commit1b8a3151bbb15322bd22bbff841803c6bc9cd7d0 (patch)
treec1ce99d16a6e2181312e65fe81570cde2d17fe5c /client.go
parent023c92c594cb928e0c5f8217ba5599daf82e93e0 (diff)
downloadrescached-1b8a3151bbb15322bd22bbff841803c6bc9cd7d0.tar.xz
all: apply recommendation from linter revive
Diffstat (limited to 'client.go')
-rw-r--r--client.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/client.go b/client.go
index 7f11a40..e7a6946 100644
--- a/client.go
+++ b/client.go
@@ -20,10 +20,10 @@ type Client struct {
}
// NewClient create new HTTP client that connect to rescached HTTP server.
-func NewClient(serverUrl string, insecure bool) (cl *Client) {
+func NewClient(serverURL string, insecure bool) (cl *Client) {
var (
httpcOpts = libhttp.ClientOptions{
- ServerUrl: serverUrl,
+ ServerUrl: serverURL,
AllowInsecure: insecure,
}
)
@@ -42,7 +42,7 @@ func (cl *Client) Blockd() (hostBlockd map[string]*Blockd, err error) {
resb []byte
)
- _, resb, err = cl.Get(httpApiBlockd, nil, nil)
+ _, resb, err = cl.Get(httpAPIBlockd, nil, nil)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -72,7 +72,7 @@ func (cl *Client) BlockdDisable(blockdName string) (blockd *Blockd, err error) {
params.Set(paramNameName, blockdName)
- _, resb, err = cl.PostForm(httpApiBlockdDisable, nil, params)
+ _, resb, err = cl.PostForm(httpAPIBlockdDisable, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -101,7 +101,7 @@ func (cl *Client) BlockdEnable(blockdName string) (blockd *Blockd, err error) {
params.Set(paramNameName, blockdName)
- _, resb, err = cl.PostForm(httpApiBlockdEnable, nil, params)
+ _, resb, err = cl.PostForm(httpAPIBlockdEnable, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -131,7 +131,7 @@ func (cl *Client) BlockdFetch(blockdName string) (blockd *Blockd, err error) {
params.Set(paramNameName, blockdName)
- _, resb, err = cl.PostForm(httpApiBlockdFetch, nil, params)
+ _, resb, err = cl.PostForm(httpAPIBlockdFetch, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -159,7 +159,7 @@ func (cl *Client) Caches() (answers []*dns.Answer, err error) {
resb []byte
)
- _, resb, err = cl.Get(httpApiCaches, nil, nil)
+ _, resb, err = cl.Get(httpAPICaches, nil, nil)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -190,7 +190,7 @@ func (cl *Client) CachesRemove(q string) (listAnswer []*dns.Answer, err error) {
params.Set(paramNameName, q)
- _, resb, err = cl.Delete(httpApiCaches, nil, params)
+ _, resb, err = cl.Delete(httpAPICaches, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -222,7 +222,7 @@ func (cl *Client) CachesSearch(q string) (listMsg []*dns.Message, err error) {
params.Set(paramNameQuery, q)
- _, resb, err = cl.Get(httpApiCachesSearch, nil, params)
+ _, resb, err = cl.Get(httpAPICachesSearch, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -248,7 +248,7 @@ func (cl *Client) Env() (env *Environment, err error) {
resb []byte
)
- _, resb, err = cl.Get(httpApiEnvironment, nil, nil)
+ _, resb, err = cl.Get(httpAPIEnvironment, nil, nil)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}
@@ -273,7 +273,7 @@ func (cl *Client) EnvUpdate(envIn *Environment) (envOut *Environment, err error)
resb []byte
)
- _, resb, err = cl.PostJSON(httpApiEnvironment, nil, envIn)
+ _, resb, err = cl.PostJSON(httpAPIEnvironment, nil, envIn)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}