Add ghost client interface

pull/1/head
Nikita Tokarchuk 2 years ago
parent c1b2b721e6
commit ec51d18cd6
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 9
      frontend/ghost/data.go
  2. 8
      frontend/ghost/ghost.go
  3. 10
      frontend/ghost/params.go

@ -0,0 +1,9 @@
package ghost
// Pages are ghost pages data
type Pages struct {
}
// Posts are ghost posts data
type Posts struct {
}

@ -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)
}

@ -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)
}
Loading…
Cancel
Save