nasaapi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIKey = "DEMO_KEY" // Default NASA API key (for demo)

Variables

This section is empty.

Functions

func Request

func Request(ctx context.Context, path string, q url.Values) (io.ReadCloser, error)

Request function requests to NASA API, and returns response data.

Types

type Date

type Date struct {
	time.Time
}

Date is wrapper class of time.Time.

func DateFrom

func DateFrom(s string) (Date, error)

DateFrom returns Date instance from date string

func NewDate

func NewDate(tm time.Time) Date

NewDate returns Date instance from time.Time.

func (Date) MarshalJSON

func (t Date) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Date) String

func (t Date) String() string

Stringer with YYYY-MM-DD format.

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.UnmarshalJSON interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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