From 78b82f5cc529096e3af61740b8e03196bb7fbab3 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Fri, 3 Dec 2021 03:55:58 +0100 Subject: [PATCH] Describe the ghost data structures --- frontend/ghost/data.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/frontend/ghost/data.go b/frontend/ghost/data.go index b7baf28..29e3720 100644 --- a/frontend/ghost/data.go +++ b/frontend/ghost/data.go @@ -1,9 +1,37 @@ package ghost +import "html/template" + // Pages are ghost pages data type Pages struct { + Pages []Post `json:"pages"` + Meta Meta `json:"meta"` +} + +// Post contains ghost post data +type Post struct { + ID string `json:"id"` + UUID string `json:"uuid"` + Title string `json:"title"` + HTML template.HTML `json:"html"` + FImage template.URL `json:"feature_image"` +} + +// Meta contains ghost result metadata +type Meta struct { + Pagination Pagination `json:"pagination"` +} + +// Pagination contains ghost pagination data +type Pagination struct { + Page int `json:"page"` + Limit int `json:"limit"` + Pages int `json:"pages"` + Total int `json:"total"` } // Posts are ghost posts data type Posts struct { + Posts []Post `json:"posts"` + Meta Meta `json:"meta"` }