Initialize http client handler

pull/1/head
Nikita Tokarchuk 3 years ago
parent ec51d18cd6
commit e3c87d5eff
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 33
      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,
}
}
Loading…
Cancel
Save