https://github.com/qba73/iss
International Space Station Go client
https://github.com/qba73/iss
api-client earth-observation gis gis-data go golang-library spacestation
Last synced: over 1 year ago
JSON representation
International Space Station Go client
- Host: GitHub
- URL: https://github.com/qba73/iss
- Owner: qba73
- License: apache-2.0
- Created: 2022-07-31T21:19:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-14T04:43:44.000Z (almost 4 years ago)
- Last Synced: 2025-02-03T12:16:40.974Z (over 1 year ago)
- Topics: api-client, earth-observation, gis, gis-data, go, golang-library, spacestation
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://godoc.org/github.com/qba73/iss)

[](https://goreportcard.com/report/github.com/qba73/iss)


# ISS
ISS is a Go library for the the [International Space Station](https://en.wikipedia.org/wiki/International_Space_Station) API. It allows to get station's current lat and long coordinates.
## Using the Go library
Import the library using
```go
import github.com/qba73/iss
```
## Creating a client
Create a new client object by calling ```iss.New()```
```go
client, err := iss.New()
if err != nil {
// handle error
}
```
If you want to use your ```http.Client```
```go
httpClient := http.Client{}
issClient, err := iss.New(iss.WithHTTPClient(&httpClient))
if err != nil {
// handle error
}
lat, long, err := issClient.GetPosition()
if err != nil {
// handle error
}
```
## Retrieving ISS coordinates using client
```go
client, err := iss.New()
if err != nil {
// handle error
}
position, err := client.GetPosition()
if err != nil {
// handle error
}
fmt.Println(position)
// Output: {10.5489 1.3942}
```
## Retrieving ISS coordinates using functions
The ```iss``` package provides a high level functions for retrieving ISS coordinates.
```go
lat, long, err := iss.GetPosition()
if err != nil {
// handle error
}
fmt.Println(lat, long)
// Output: -8.0037 14.7139
```
```go
lat, long, err := iss.GetPositionAsStrings()
if err != nil {
// handle error
}
fmt.Println(lat, long)
// Output: -11.6732 17.4279
```
## A complete example program
You can see an example program which retrieves the ISS coordinates in the [examples/demo](examples/demo/main.go) folder.