Documentation ¶
Index ¶
- Constants
- type WebClient
- func (w *WebClient) FastGet(ctx context.Context, requestURI string) (*fasthttp.Response, error)
- func (w *WebClient) FastPatchByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error)
- func (w *WebClient) FastPostByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error)
- func (w *WebClient) FastPutByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error)
- func (w *WebClient) SetLogger(logger log.Logger) *WebClient
- type WebClientInterface
Constants ¶
View Source
const ( AcceptJSON = "application/json" AcceptXML = "application/xml" ContentJSON = "application/json; charset=utf-8" ContentXML = "application/xml; charset=utf-8" ContentTextXML = "text/xml; charset=utf-8" HTTPMethodPOST = "POST" HTTPMethodPUT = "PUT" HTTPMethodPATCH = "PATCH" HTTPMethodGET = "GET" DefaultTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebClient ¶
type WebClient struct { TargetService string BaseURI string JwtToken string UserAgent string ContentType string Accept string TimeOut time.Duration Debug bool Authentication bool GzipRequest bool // contains filtered or unexported fields }
func New ¶
func New(cfg contracts.SideRestServiceInterface, serviceName string) *WebClient
New creates Default setup for default fast http client.
func (*WebClient) FastPatchByte ¶
func (w *WebClient) FastPatchByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error)
FastPatchByte do PATCH request via fasthttp.
func (*WebClient) FastPostByte ¶
func (w *WebClient) FastPostByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error)
FastPostByte do POST request via fasthttp.
type WebClientInterface ¶
type WebClientInterface interface { SetLogger(logger log.Logger) FastPostByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error) FastPutByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error) FastPatchByte(ctx context.Context, requestURI string, body []byte) (*fasthttp.Response, error) FastGet(ctx context.Context, requestURI string) (*fasthttp.Response, error) }
Click to show internal directories.
Click to hide internal directories.