grpc

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll added in v0.5.2

func CloseAll()

关闭所有连接

Types

type Client

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

orange框架内部grpc调用客户端

func NewClient

func NewClient(addr string) *Client

func (*Client) Header

func (c *Client) Header(key, value string) *Client

Header 原样保持header头大小写设置

func (*Client) RunGRPC

func (c *Client) RunGRPC(apiUri string) (clientResp *ClientResp, err error)

RunGet 执行Post请求

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout int) *Client

SetTimeout 设置超时

func (*Client) WithBody

func (c *Client) WithBody(bodyStream string) *Client

直接传递body中的参数

func (*Client) WithParams

func (c *Client) WithParams(obj interface{}) *Client

参数设置 默认将结构体转成json

type ClientResp

type ClientResp struct {
	Body           []byte // response body
	ResponseStatus int
	RequestTime    time.Duration
}

func (*ClientResp) GetRequestTime

func (c *ClientResp) GetRequestTime() time.Duration

func (*ClientResp) String

func (c *ClientResp) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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