Back to godoc.org

Package apod

v0.5.2
Latest Go to latest

The latest major version is .

Published: Mar 23, 2020 | License: ISC | Module: framagit.org/andinus/cetus

Index

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

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.

Package Files

  • json.go
  • print.go
  • rand.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier