Skip to content

Commit

Permalink
Merge pull request #104 from observerly/feature/catalog/NewSIMBADServ…
Browse files Browse the repository at this point in the history
…iceClient

feat: add NewSIMBADServiceClient to catalog module in @observerly/skysolve
  • Loading branch information
michealroberts authored Nov 25, 2024
2 parents 9e5b1de + c4584dd commit c5439f4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/catalog/simbad.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ package catalog
/*****************************************************************************************************************/

import (
"net/url"
"time"

"github.com/observerly/skysolve/pkg/adql"
)

Expand All @@ -32,3 +35,28 @@ type SIMBADServiceClient struct {
}

/*****************************************************************************************************************/

func NewSIMBADServiceClient() *SIMBADServiceClient {
// https://simbad.unistra.fr/simbad/sim-tap/sync
url := url.URL{
Scheme: "https",
Host: "simbad.unistra.fr",
Path: "/simbad/sim-tap/sync",
}

headers := map[string]string{
// Default content type for TAP services
"Content-Type": "application/x-www-form-urlencoded",
// Ensure we are good citizens and identify ourselves:
"X-Requested-By": "@observerly/skysolve",
}

client := adql.NewTapClient(url, 60*time.Second, headers)

return &SIMBADServiceClient{
TapClient: client,
Query: SIMBADQuery{},
}
}

/*****************************************************************************************************************/

0 comments on commit c5439f4

Please sign in to comment.