isslocation

package
v0.0.0-...-5cd182a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIssLocation

func GetIssLocation[R any](ctx context.Context, c *Client) (*R, error)

Get the current location of the International Space Station You can define a custom result to unmarshal the response into.

GET /iss-now.json

func GetPeopleInSpace

func GetPeopleInSpace[R any](ctx context.Context, c *Client) (*R, error)

Get a list of astronauts currently in space You can define a custom result to unmarshal the response into.

GET /astros.json

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new Client.

func (*Client) GetIssLocation

func (c *Client) GetIssLocation(ctx context.Context) (*ISSLocation, error)

Get the current location of the International Space Station

GET /iss-now.json

func (*Client) GetPeopleInSpace

func (c *Client) GetPeopleInSpace(ctx context.Context) (*PeopleInSpace, error)

Get a list of astronauts currently in space

GET /astros.json

type ISSLocation

type ISSLocation struct {
	Timestamp   int         `json:"timestamp,omitzero"`
	IssPosition ISSPosition `json:"iss_position"`
	Message     string      `json:"message,omitzero"`
}

ISSLocation defines a model

type ISSPosition

type ISSPosition struct {
	Longitude string `json:"longitude,omitzero"`
	Latitude  string `json:"latitude,omitzero"`
}

ISSPosition defines a model

type People

type People []Person

People defines a model

type PeopleInSpace

type PeopleInSpace struct {
	People  People `json:"people,omitempty"`
	Number  int    `json:"number,omitzero"`
	Message string `json:"message,omitzero"`
}

PeopleInSpace defines a model

type Person

type Person struct {
	Craft string `json:"craft,omitzero"`
	Name  string `json:"name,omitzero"`
}

Person defines a model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL