Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) MobileGet(ctx context.Context, phone string, key string, ...) (*MobileGetResult, error)
- func (c *Client) SetClientIP(clientIP string) *Client
- func (c *Client) SetLogFun(logFun gorequest.LogFunc)
- func (c *Client) SetTrace(trace bool)
- func (c *Client) TraceEndSpan()
- func (c *Client) TraceGetSpanID() (spanID string)
- func (c *Client) TraceGetTraceID() (traceID string)
- func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
- func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)
- func (c *Client) TraceSetStatus(code codes.Code, description string)
- func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context
- type ClientConfig
- type MobileGetResponse
- type MobileGetResult
Constants ¶
View Source
const (
LogTable = "juhe"
)
View Source
const (
Version = "1.0.1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) MobileGet ¶
func (c *Client) MobileGet(ctx context.Context, phone string, key string, notMustParams ...gorequest.Params) (*MobileGetResult, error)
MobileGet 手机号码归属地 https://www.juhe.cn/docs/api/id/11
func (*Client) SetClientIP ¶ added in v1.0.1
SetClientIP 配置
func (*Client) TraceEndSpan ¶ added in v1.0.1
func (c *Client) TraceEndSpan()
TraceEndSpan 结束OpenTelemetry链路追踪状态
func (*Client) TraceGetSpanID ¶ added in v1.0.1
TraceGetSpanID 获取OpenTelemetry链路追踪SpanID
func (*Client) TraceGetTraceID ¶ added in v1.0.1
TraceGetTraceID 获取OpenTelemetry链路追踪TraceID
func (*Client) TraceRecordError ¶ added in v1.0.1
func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
TraceRecordError 记录OpenTelemetry链路追踪错误
func (*Client) TraceSetAttributes ¶ added in v1.0.1
TraceSetAttributes 设置OpenTelemetry链路追踪属性
func (*Client) TraceSetStatus ¶ added in v1.0.1
TraceSetStatus 设置OpenTelemetry链路追踪状态
type MobileGetResponse ¶
type MobileGetResponse struct { Resultcode string `json:"resultcode"` // 返回码 Reason string `json:"reason"` // 返回说明 Result struct { Province string `json:"province"` // 省份 City string `json:"city"` // 城市,(部分记录可能为空) Areacode string `json:"areacode"` // 区号,(部分记录可能为空) Zip string `json:"zip"` // 邮编,(部分记录可能为空) Company string `json:"company"` // 运营商 Card string `json:"card,omitempty"` } `json:"result"` // 返回结果集 }
type MobileGetResult ¶
type MobileGetResult struct { Result MobileGetResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
Click to show internal directories.
Click to hide internal directories.