gin_remote_service

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock func() (body []byte)

type Option

type Option func(*option)

func WithHeader

func WithHeader(key, value string) Option

func WithJaegerContext

func WithJaegerContext(jaegerContext *gin.Context) Option

func WithLogger

func WithLogger(l *zap.Logger) Option

func WithMock

func WithMock(m Mock) Option

func WithOnFailedRetry

func WithOnFailedRetry(retryTimes int, retryDelay time.Duration, retryVerify RetryVerify) Option

func WithTTL

func WithTTL(ttl time.Duration) Option

type ResponseData

type ResponseData struct {
	Data []byte
	Code int
}

func Delete

func Delete(url string, form httpUrl.Values, options ...Option) (resp *ResponseData, err error)

Delete delete 请求

func Get

func Get(url string, form httpUrl.Values, options ...Option) (resp *ResponseData, err error)

Get get 请求

func PatchFrom

func PatchFrom(url string, form httpUrl.Values, options ...Option) (resp *ResponseData, err error)

PatchFrom patch form 请求

func PatchJSON

func PatchJSON(url string, raw json.RawMessage, options ...Option) (resp *ResponseData, err error)

PatchJSON patch json 请求

func PostForm

func PostForm(url string, form httpUrl.Values, options ...Option) (resp *ResponseData, err error)

PostForm post form 请求

func PostJSON

func PostJSON(url string, raw json.RawMessage, options ...Option) (resp *ResponseData, err error)

PostJSON post json 请求

func PutForm

func PutForm(url string, form httpUrl.Values, options ...Option) (resp *ResponseData, err error)

PutForm put form 请求

func PutJSON

func PutJSON(url string, raw json.RawMessage, options ...Option) (resp *ResponseData, err error)

PutJSON put json 请求

type RetryVerify

type RetryVerify func(body []byte) (shouldRetry bool)

Jump to

Keyboard shortcuts

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