123456789101112131415161718192021222324252627282930 |
- package client
- import (
- "fmt"
- "net/url"
- )
- const (
- versionUrl = "/ds/api/version"
- )
- func (c *Client) Version(baseUrl string) error {
- fullUrl, err := url.JoinPath(baseUrl, versionUrl)
- if err != nil {
- return err
- }
- resp := new(MsgResponse)
- err = c.get("", fullUrl, nil, resp)
- if err != nil {
- return err
- }
- if !resp.Success {
- return fmt.Errorf("version: %s", resp.Msg)
- }
- return nil
- }
|