summary refs log tree commit diff stats
path: root/pkg/apod/print.go
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-03-18 23:04:21 +0530
committerAndinus <andinus@nand.sh>2020-03-18 23:04:21 +0530
commit052140fb3ccd4b386d8d98ba7355d676c1e0693d (patch)
tree13a01d6c98e1e4875b4fba4fc12d67814b2a23d2 /pkg/apod/print.go
parent2f15edf548ec131d2eb97bd5338a1adef768acea (diff)
downloadcetus-052140fb3ccd4b386d8d98ba7355d676c1e0693d.tar.gz
Initial commit for Cetus v0.5.0 v0.5.0
Diffstat (limited to 'pkg/apod/print.go')
-rw-r--r--pkg/apod/print.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/apod/print.go b/pkg/apod/print.go
new file mode 100644
index 0000000..a087665
--- /dev/null
+++ b/pkg/apod/print.go
@@ -0,0 +1,19 @@
+package apod
+
+import (
+	"fmt"
+)
+
+// Print will print the json output
+func Print(res Res) {
+	fmt.Printf("Title: %s\n\n", res.Title)
+	fmt.Printf("Copyright: %s\n", res.Copyright)
+	fmt.Printf("Date: %s\n\n", res.Date)
+	fmt.Printf("Media Type: %s\n", res.MediaType)
+	if res.MediaType == "image" {
+		fmt.Printf("URL: %s\n\n", res.HDURL)
+	} else {
+		fmt.Printf("URL: %s\n\n", res.URL)
+	}
+	fmt.Printf("Explanation: %s\n", res.Explanation)
+}