mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
a26683e01d
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/
23 lines
470 B
Go
23 lines
470 B
Go
package jira
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/go-jira/jira/jiradata"
|
|
)
|
|
|
|
func ServerInfo(ua HttpClient, endpoint string) (*jiradata.ServerInfo, error) {
|
|
uri := URLJoin(endpoint, "rest/api/2/serverInfo")
|
|
resp, err := ua.GetJSON(uri)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer resp.Body.Close()
|
|
|
|
if resp.StatusCode == 200 {
|
|
results := jiradata.ServerInfo{}
|
|
return &results, json.NewDecoder(resp.Body).Decode(&results)
|
|
}
|
|
return nil, responseError(resp)
|
|
}
|