package api

type DatahubClient struct {
	APIEndpoint string
	token       string
}

func NewDatahubClient(apiEndpoint string, token string) *DatahubClient {
	return &DatahubClient{
		APIEndpoint: apiEndpoint,
		token:       token,
	}
}

/*func (cli *DatahubClient) doRquest(query string, data interface{}) error {
	// Create a new HTTP POST request with the GraphQL query as the body
	req, err := http.NewRequest("POST", cli.APIEndpoint, bytes.NewBuffer([]byte(query)))
	if err != nil {
		fmt.Println(err)
		return errors.Trace(err)
	}

	// Set the Content-Type header to application/json
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", cli.token))

	// Create a new HTTP client and execute the request
	client := &http.Client{}
	res, err := client.Do(req)
	if err != nil {
		return errors.Trace(err)
	}
	defer res.Body.Close()

	// Parse the response JSON into a struct
	if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
		return errors.Trace(err)
	}

	return nil
}*/
