Vasiliy Tolstov 7eb4f37bed
Some checks failed
build / test (push) Failing after 13s
build / lint (push) Successful in 19s
codeql / analyze (go) (push) Failing after 1m30s
comment unused funcs
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-12-12 09:13:30 +03:00

48 lines
908 B
Go

package vault
/*
func getKVinfo(cli *api.Client, path string) (string, int, error) {
info, err := getKVmount(cli, path)
if err != nil {
return "", 0, err
}
switch info {
case "1":
return "", 1, nil
case "2":
return "data", 2, nil
}
return "", 0, fmt.Errorf("Vault engine version info not found: %s", path)
}
func getKVmount(cli *api.Client, path string) (string, error) {
requestpath := "/v1/sys/mounts/" + path
rsp, err := cli.RawRequest(cli.NewRequest("GET", requestpath))
if err != nil {
return "", err
}
defer rsp.Body.Close()
type MountInfo struct {
Data struct {
Options struct {
Version string `json:"version"`
} `json:"options"`
} `json:"data"`
}
info := &MountInfo{}
if err = json.NewDecoder(rsp.Body).Decode(info); err != nil {
return "", err
}
if info.Data.Options.Version == "" {
return "1", nil
}
return info.Data.Options.Version, nil
}
*/