Add ghost client interface

This commit is contained in:
2021-12-03 03:41:37 +01:00
parent c1b2b721e6
commit ec51d18cd6
3 changed files with 27 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
package ghost
// Pages are ghost pages data
type Pages struct {
}
// Posts are ghost posts data
type Posts struct {
}
+8
View File
@@ -0,0 +1,8 @@
package ghost
// Client is the ghost backend client
type Client interface {
GetPosts(params ...QueryParam) (posts *Posts, err error)
GetPostBySlug(slug string, params ...QueryParam) (posts *Posts, err error)
GetPageBySlug(slug string) (pages *Pages, err error)
}
+10
View File
@@ -0,0 +1,10 @@
package ghost
import (
"github.com/valyala/fasthttp"
)
// QueryParam is the generic query param applier
type QueryParam interface {
Apply(headers *fasthttp.RequestHeader, args *fasthttp.Args)
}