apod

package
Version: v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJson

func GetJson(reqInfo map[string]string) (string, error)

GetJson returns json response received from the api

func Print

func Print(res Res)

Print will print the json output

func RandDate

func RandDate() string

RandDate returns a random date between 1995-06-16 & today

func UnmarshalJson

func UnmarshalJson(res *Res, body string) error

UnmarshalJson will take body as input & unmarshal it to res

Types

type Res

type Res struct {
	Copyright      string `json:"copyright"`
	Date           string `json:"date"`
	Explanation    string `json:"explanation"`
	HDURL          string `json:"hdurl"`
	MediaType      string `json:"media_type"`
	ServiceVersion string `json:"service_version"`
	Title          string `json:"title"`
	URL            string `json:"url"`

	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Res holds the response from the api.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL