mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
vendor: update go-grafana-api to not require unneeded dependencies
This commit is contained in:
parent
3897582c42
commit
8f6b003ff7
2 changed files with 1 additions and 25 deletions
1
vendor/github.com/teemupo/go-grafana-api/README_ethereum.md
generated
vendored
Normal file
1
vendor/github.com/teemupo/go-grafana-api/README_ethereum.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Removed Client.CreateUserForm due to "github.com/grafana/grafana/pkg/api/dtos" dependency.
|
||||||
25
vendor/github.com/teemupo/go-grafana-api/admin.go
generated
vendored
25
vendor/github.com/teemupo/go-grafana-api/admin.go
generated
vendored
|
|
@ -1,35 +1,10 @@
|
||||||
package gapi
|
package gapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/api/dtos"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) CreateUserForm(settings dtos.AdminCreateUserForm) error {
|
|
||||||
data, err := json.Marshal(settings)
|
|
||||||
req, err := c.newRequest("POST", "/api/admin/users", bytes.NewBuffer(data))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
resp, err := c.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err = ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
return errors.New(resp.Status)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) DeleteUser(id int64) error {
|
func (c *Client) DeleteUser(id int64) error {
|
||||||
req, err := c.newRequest("DELETE", fmt.Sprintf("/api/admin/users/%d", id), nil)
|
req, err := c.newRequest("DELETE", fmt.Sprintf("/api/admin/users/%d", id), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue