http

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterRequestPlugin added in v1.0.17

type AfterRequestPlugin interface {
	Handle(ctx context.Context, req *http.Request, resp *http.Response) error
}

type BeforeRequestPlugin added in v1.0.17

type BeforeRequestPlugin interface {
	Handle(ctx context.Context, req *http.Request) error
}

type JaegerBeforePlugin added in v1.0.17

type JaegerBeforePlugin struct{}

func (*JaegerBeforePlugin) Handle added in v1.0.17

func (*JaegerBeforePlugin) Handle(ctx context.Context, req *http.Request) error

type Option

type Option func(r *RPC)

func WithAfterPlugins added in v1.0.17

func WithAfterPlugins(plugins ...AfterRequestPlugin) Option

func WithBeforePlugins added in v1.0.17

func WithBeforePlugins(plugins ...BeforeRequestPlugin) Option

func WithCodec added in v1.0.17

func WithCodec(c codec.Codec) Option

func WithLogger

func WithLogger(logger *loggingRPC.RPCLogger) Option

type RPC

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

func New

func New(opts ...Option) *RPC

func (*RPC) Send

func (r *RPC) Send(ctx context.Context, serviceName, method, uri string, header http.Header, timeout time.Duration, reqData interface{}, respData interface{}) (ret Response, err error)

Send is send HTTP request

type Response

type Response struct {
	HTTPCode int
	Response []byte
}

Jump to

Keyboard shortcuts

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