httpclient

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteHttp added in v0.0.20

func ExecuteHttp(ctx context.Context, commonResty *resty.Client, p *HttpParams, result interface{}) (err error)

func MustNewRestyWith

func MustNewRestyWith(portName aconfig.PortName, appConfig *aconfig.Application, protocol string) *resty.Client

func NewResty

func NewResty(sugar *zap.SugaredLogger) *resty.Client

func NewRestyWith

func NewRestyWith(portName aconfig.PortName, appConfig *aconfig.Application, protocol string) (*resty.Client, error)

Types

type HttpParams added in v0.0.20

type HttpParams struct {
	Method  string
	Url     string
	Headers map[string]string
	Queries map[string]string
	Body    interface{}
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(sugar *zap.SugaredLogger) *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(format string, v ...interface{})

type RespWrapper

type RespWrapper struct {
	Response  *resty.Response
	FuncError error
	// contains filtered or unexported fields
}

func Wrapper

func Wrapper(r *resty.Response, funcError error) *RespWrapper

func (*RespWrapper) Error

func (rp *RespWrapper) Error() interface{}

func (*RespWrapper) Parse

func (rp *RespWrapper) Parse() (err error)

func (*RespWrapper) Result

func (rp *RespWrapper) Result() interface{}

func (*RespWrapper) WithError

func (rp *RespWrapper) WithError(err interface{}) *RespWrapper

func (*RespWrapper) WithResult

func (rp *RespWrapper) WithResult(result interface{}) *RespWrapper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL