refactor and removing unused code

This commit is contained in:
Alexander Zobnin
2020-06-02 17:18:38 +03:00
parent a5f8eb02bb
commit ff0b8b9dff
4 changed files with 50 additions and 194 deletions

View File

@@ -60,6 +60,12 @@ func (ds *ZabbixDatasourceInstance) ZabbixAPIQuery(ctx context.Context, apiReq *
return BuildAPIResponse(&result)
}
func BuildAPIResponse(responseData *interface{}) (*ZabbixAPIResourceResponse, error) {
return &ZabbixAPIResourceResponse{
Result: *responseData,
}, nil
}
// TestConnection checks authentication and version of the Zabbix API and returns that info
func (ds *ZabbixDatasourceInstance) TestConnection(ctx context.Context) (string, error) {
_, err := ds.getAllGroups(ctx)