client

package
v0.1.1-0...-23b392f Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, c IClient, request interface{}) (*anypb.Any, error)

Execute 解析、执行请求,返回响应

func GetCallerName

func GetCallerName() string

GetCallerName 获取上游调用者的方法名称

Types

type Config

type Config struct {
	RetryTimes        int
	HttpClientTimeout time.Duration
}

type Error

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

Error 用户描述common.response中的errno、errmsg错误信息,业务端需要关心

func NewError

func NewError(code int32, msg string) *Error

func (Error) Error

func (e Error) Error() string

type IClient

type IClient interface {
	GetAppName() string
	GetRetryTimes() int
	GetEndpoint() string
	GetApiInfo(key string) map[string]string
	HttpClient() http.Client
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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