package
0.1.1
Repository: https://github.com/rohanraj7316/middleware.git
Documentation: pkg.go.dev

# README

Httpclient

Wrapper build on httpclient

Signature

func New(config ...httpclient.Config) (*HttpClient, error)

Config

// https://github.com/rohanraj7316/httpclient config
type Config struct {
	// Timeout gives you timeout for request
	// Default: 30s
	Timeout time.Duration

	// bool flag which help us in configuring proxy
	// Default: false
	UseProxy bool

	// url need to do the proxy
	// Default: nil
	ProxyURL string

	// LogReqResEnable helps in logging request & responses.
	// Default true
	LogReqResEnable bool

	// LogReqResBodyEnable helps in logging request and responses body
	// Default true
	LogReqResBodyEnable bool
}

Option And OptionSDK

both are request options with only context difference.

type OptionSDK struct {
	Ctx         context.Context
	Method      string
	Url         string
	Header      map[string]string
	RequestBody io.Reader
}

Request

// Request should be used for sending http request with in
// resource model. helps to use fiber.Ctx insted of generating
// onw of it's own.
// Note: never create your own context.

RequestSDK

// RequestSDK should be used to send http request.
// trigger it from SDK. has an added layer for checking
// requestId.
// Note: never create your own context.

# Functions

New configure httpclient with the Config passed.

# Structs

No description provided by the author
Option used for Request func.
OptionSDK used for RequestSDK func.