Documentation ¶
Overview ¶
Package httpclient provides http client used for SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a http client for SDK.
type Config ¶
type Config struct { URL string `v:"required"` // Service address. Eg: user.svc.local, http://user.svc.local Client *gclient.Client // Custom underlying client. Handler Handler // Custom response handler. Logger *glog.Logger // Custom logger. RawDump bool // Whether auto dump request&response in stdout. }
Config is the configuration struct for SDK client.
type DefaultHandler ¶ added in v2.7.1
DefaultHandler handle ghttp.DefaultHandlerResponse of json format.
func NewDefaultHandler ¶ added in v2.7.1
func NewDefaultHandler(logger *glog.Logger, rawRump bool) *DefaultHandler
func (DefaultHandler) HandleResponse ¶ added in v2.7.1
type Handler ¶ added in v2.7.1
type Handler interface { // HandleResponse handles the http response and transforms its body to the specified object. // The parameter `out` specifies the object that the response body is transformed to. HandleResponse(ctx context.Context, res *gclient.Response, out interface{}) error }
Handler is the interface for http response handling.
Click to show internal directories.
Click to hide internal directories.