From e3c87d5eff2892b8d63818b03d9524743b5ee9b7 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Fri, 3 Dec 2021 03:48:40 +0100 Subject: [PATCH] Initialize http client handler --- frontend/ghost/client.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 frontend/ghost/client.go diff --git a/frontend/ghost/client.go b/frontend/ghost/client.go new file mode 100644 index 0000000..cc99485 --- /dev/null +++ b/frontend/ghost/client.go @@ -0,0 +1,33 @@ +package ghost + +import ( + "time" + + "github.com/valyala/fasthttp" +) +// Ghost content data URIs: +const ( + ghostAPIPrefix = "/ghost/api/v3/" +) + +// HTTPClient implements the ghost http client +type HTTPClient struct { + QueryTimeout time.Duration + ContentKey string + Addr string + Secured bool + + client *fasthttp.HostClient +} + +// setupClient creates the default http client +func (g *HTTPClient) setupClient() { + + g.client = &fasthttp.HostClient{ + Addr: g.Addr, + IsTLS: g.Secured, + + DisableHeaderNamesNormalizing: true, + DisablePathNormalizing: true, + } +}