Documentation ¶
Index ¶
- Constants
- Variables
- func GetCardStatusPB(cardStatus string) string
- type Adder
- type BalanceRealSingle
- type BalanceRealSingleResp
- type BaseQuery
- type BaseQueryNoCardId
- type BaseQueryWithCardInfo
- type BaseQueryWithDate
- type BaseQueryWithDate1
- type BaseResponse
- type CMIOTClient
- func (c *CMIOTClient) GetBalanceRealSingle(msidsn string) (*BalanceRealSingle, error)
- func (c *CMIOTClient) GetGprsRealSingle(msisdn string) (*GprsRealSingle, error)
- func (c *CMIOTClient) GetGprsUsedInfSingle(Msisdn string) (*GprsUsedInfoSingle, error)
- func (c *CMIOTClient) GetGprsUsedInfoSingleByDate(msidsn string, queryDate string) (*GprsUsedInfoSingleByDate, error)
- func (c *CMIOTClient) GetGroupUserInfo(queryDate string) (*GroupUserInfo, error)
- func (c *CMIOTClient) GetOnOff(Msisdn string) (bool, error)
- func (c *CMIOTClient) GetSimDataMargin(Msisdn string) (*Gprs, error)
- func (c *CMIOTClient) GetSimStatus(Msisdn string) (string, error)
- func (c *CMIOTClient) GetUnnormalCount() (int64, error)
- func (c *CMIOTClient) QueryCardCount() (*QueryCardCount, error)
- func (c *CMIOTClient) QueryCardInfo(card_info string, card_type int) (*CardInfo, error)
- func (c *CMIOTClient) QueryCardLifeCycle(Msisdn string) (bool, error)
- func (c *CMIOTClient) SetDebug(debug bool)
- func (c *CMIOTClient) SetForwarderId(ip string) bool
- type CMIOTHttp
- type CardInfo
- type CardUnusualNum
- type Gprs
- type GprsBatch
- type GprsBatchResult
- type GprsRealSingle
- type GprsRealSingleResp
- type GprsRealTimeInfo
- type GprsUsedInfoSingle
- type GprsUsedInfoSingleByDate
- type GprsUsedInfoSingleByDateResp
- type GprsUsedInfoSingleResp
- type GroupUserInfo
- type GroupUserInfoResp
- type PublicQuery
- type QueryCardCount
- type QueryCardCountResp
- type QueryCardInfoResp
- type QueryEncode
- type UserLifeCyCle
- type UserOnOffRealSingle
- type UserStatusRealSingle
Constants ¶
View Source
const ( EBID_gprsrealsingle = "0001000000008" //在线信息实时查询 EBID_userstatusrealsingle = "0001000000009" //用户状态信息实时查询 EBID_cardinfo = "0001000000010" //码号信息查询 EBID_gprsusedinfosingle = "0001000000012" //用户当月GPRS查询 EBID_onandoffrealsingle = "0001000000025" //开关机状态实时查询 //EBID_batchsmsusedbydate = "0001000000026" //短信使用信息批量查询 //EBID_batchgprsusedbydate = "0001000000027" //流量使用信息批量查询 EBID_balancerealsingle = "0001000000035" //用户余额信息实时查询 //EBID_smsusedinfosingle = "0001000000036" //用户当月短信查询 //EBID_smsstatusreset = "0001000000034" // 短信状态重置 EBID_groupuserinfo = "0001000000039" //集团用户数查询 //EBID_smsusedbydate = "0001000000040" //用户短信使用查询 EBID_gprsrealtimeinfo = "0001000000083" //套餐内GPRS流量使用情况实时查询 EBID_arrearageuserinfo = "0001000000328" //欠费停机用户批量查询 //EBID_querycardprodinfo = "0001000000264" //物联卡资费套餐查询接口 EBID_gprsusedinfosinglebydate = "0001000000407" //物联卡单日GPRS使用量查询 EBID_querycardcount = "0001000000417" //集团各生命周期物联卡数量查询 EBID_queryabnormalcardcount = "0001000000427" //集团异常状态物联卡数据量查询 //EBID_querygprsonlinecardcount = "0001000000428" //集团GPRS在线物联卡数量查询 //EBID_querysmsopenstatus = "0001000000429" //物联卡短信服务开通查询 //EBID_querygprsopenstatus = "0001000000430" //物联卡GPRS服务开通查询 //EBID_queryapnopenstatus = "0001000000431" //物联卡APN服务开通查询 EBID_querycardlifecycle = "0001000000432" //物联卡生命周期查询 )
View Source
const (
APIBASE = "https://api.iot.10086.cn/v2/"
)
View Source
const (
DEFAULT_HTTP_TIMEOUT = 3000 //ms
)
Variables ¶
View Source
var DefaultTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, MaxIdleConns: 500, MaxIdleConnsPerHost: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }
View Source
var ErrUnsupported = errors.New("qryEncode:Unsupported type")
ErrUnsupported Unsupported type error returned
Functions ¶
func GetCardStatusPB ¶ added in v0.0.7
Types ¶
type BalanceRealSingle ¶ added in v0.0.6
type BalanceRealSingle struct {
Balance string `json:"balance"`
}
type BalanceRealSingleResp ¶ added in v0.0.6
type BalanceRealSingleResp struct { *BaseResponse Result []*BalanceRealSingle `json:"result"` }
type BaseQuery ¶
type BaseQuery struct { *PublicQuery Msisdn string `query:"msisdn"` }
type BaseQueryNoCardId ¶ added in v0.0.6
type BaseQueryNoCardId struct {
*PublicQuery
}
type BaseQueryWithCardInfo ¶ added in v0.1.1
type BaseQueryWithCardInfo struct { *PublicQuery CardInfo string `query:"card_info"` CardType int `query:"type"` }
type BaseQueryWithDate ¶ added in v0.0.6
type BaseQueryWithDate struct { *PublicQuery Msisdn string `query:"msisdn"` QueryDate string `query:"query_date"` }
type BaseQueryWithDate1 ¶ added in v0.0.7
type BaseQueryWithDate1 struct { *PublicQuery Msisdn string `query:"msisdn"` QueryDate string `query:"queryDate"` }
type BaseResponse ¶
type CMIOTClient ¶
type CMIOTClient struct {
// contains filtered or unexported fields
}
func NewCMIOTClient ¶
func NewCMIOTClient(apiId string, apiPassword string, ecid string) *CMIOTClient
func (*CMIOTClient) GetBalanceRealSingle ¶ added in v0.0.6
func (c *CMIOTClient) GetBalanceRealSingle(msidsn string) (*BalanceRealSingle, error)
EBID_balancerealsingle
func (*CMIOTClient) GetGprsRealSingle ¶ added in v0.0.6
func (c *CMIOTClient) GetGprsRealSingle(msisdn string) (*GprsRealSingle, error)
EBID_gprsrealsingle 在线信息实时查询
func (*CMIOTClient) GetGprsUsedInfSingle ¶ added in v0.0.6
func (c *CMIOTClient) GetGprsUsedInfSingle(Msisdn string) (*GprsUsedInfoSingle, error)
EBID_gprsusedinfosingle
func (*CMIOTClient) GetGprsUsedInfoSingleByDate ¶ added in v0.0.6
func (c *CMIOTClient) GetGprsUsedInfoSingleByDate(msidsn string, queryDate string) (*GprsUsedInfoSingleByDate, error)
EBID_gprsusedinfosinglebydate
func (*CMIOTClient) GetGroupUserInfo ¶ added in v0.0.6
func (c *CMIOTClient) GetGroupUserInfo(queryDate string) (*GroupUserInfo, error)
EBID_groupuserinfo
func (*CMIOTClient) GetOnOff ¶
func (c *CMIOTClient) GetOnOff(Msisdn string) (bool, error)
EBID_onandoffrealsingle
func (*CMIOTClient) GetSimDataMargin ¶
func (c *CMIOTClient) GetSimDataMargin(Msisdn string) (*Gprs, error)
EBID_gprsrealtimeinfo
func (*CMIOTClient) GetSimStatus ¶
func (c *CMIOTClient) GetSimStatus(Msisdn string) (string, error)
EBID_userstatusrealsingle
func (*CMIOTClient) GetUnnormalCount ¶
func (c *CMIOTClient) GetUnnormalCount() (int64, error)
EBID_queryabnormalcardcount
func (*CMIOTClient) QueryCardCount ¶ added in v0.0.6
func (c *CMIOTClient) QueryCardCount() (*QueryCardCount, error)
EBID_querycardcount
func (*CMIOTClient) QueryCardInfo ¶ added in v0.1.1
func (c *CMIOTClient) QueryCardInfo(card_info string, card_type int) (*CardInfo, error)
EBID_cardinfo
func (*CMIOTClient) QueryCardLifeCycle ¶
func (c *CMIOTClient) QueryCardLifeCycle(Msisdn string) (bool, error)
EBID_querycardlifecycle
func (*CMIOTClient) SetDebug ¶ added in v0.0.5
func (c *CMIOTClient) SetDebug(debug bool)
func (*CMIOTClient) SetForwarderId ¶
func (c *CMIOTClient) SetForwarderId(ip string) bool
type CMIOTHttp ¶
type CMIOTHttp struct {
// contains filtered or unexported fields
}
func NewCMIOTHttp ¶
func NewCMIOTHttp() *CMIOTHttp
func (*CMIOTHttp) SetTransport ¶
func (this *CMIOTHttp) SetTransport(transport http.RoundTripper)
type CardUnusualNum ¶
type CardUnusualNum struct { *BaseResponse Result []struct { CardUnusualNum string `json:"cardUnusualNum"` } `json:"result"` }
type GprsBatch ¶
type GprsBatch struct { Status string `json:"status"` Message string `json:"message"` Msisdn string `json:"msisdn"` ProdId string `json:"prodId"` PodInstId string `json:"podInstId"` ProdName string `json:"prodName"` GprsTotal string `json:"gprsTotal"` GprsUsed string `json:"gprsUsed"` GprsLeft string `json:"gprsLeft"` }
type GprsBatchResult ¶
type GprsBatchResult struct { *BaseResponse Result []GprsBatch `json:"result"` }
type GprsRealSingle ¶ added in v0.0.6
type GprsRealSingleResp ¶ added in v0.0.6
type GprsRealSingleResp struct { *BaseResponse Result []*GprsRealSingle `json:"result"` }
type GprsRealTimeInfo ¶
type GprsRealTimeInfo struct { *BaseResponse Result []struct { Gprs []*Gprs `json:"gprs"` } `json:"result"` }
type GprsUsedInfoSingle ¶ added in v0.0.6
type GprsUsedInfoSingle struct {
TotalGps string `json:"total_gprs"`
}
type GprsUsedInfoSingleByDate ¶ added in v0.0.6
type GprsUsedInfoSingleByDate struct {
Gprs string `json:"gprs"`
}
type GprsUsedInfoSingleByDateResp ¶ added in v0.0.6
type GprsUsedInfoSingleByDateResp struct { *BaseResponse Result []*GprsUsedInfoSingleByDate `json:"result"` }
type GprsUsedInfoSingleResp ¶ added in v0.0.6
type GprsUsedInfoSingleResp struct { *BaseResponse Result []*GprsUsedInfoSingle `json:"result"` }
type GroupUserInfo ¶ added in v0.0.6
type GroupUserInfo struct {
Total string `json:"total"`
}
type GroupUserInfoResp ¶ added in v0.0.6
type GroupUserInfoResp struct { *BaseResponse Result []*GroupUserInfo `json:"result"` }
type PublicQuery ¶
type QueryCardCount ¶ added in v0.0.6
type QueryCardCount struct { NormalNum int `json:"normalnum"` OtherNum int `json:"othernum"` SleepNum int `json:"sleepnum"` TestNum int `json:"testnum"` }
"normalnum": "28596", "othernum": "3", "sleepnum": "2001", "testnum": "564"
type QueryCardCountResp ¶ added in v0.0.6
type QueryCardCountResp struct { *BaseResponse Result []*QueryCardCount `json:"result"` }
type QueryCardInfoResp ¶ added in v0.1.1
type QueryCardInfoResp struct { *BaseResponse Result []*CardInfo `json:"result"` }
type QueryEncode ¶
type QueryEncode struct {
// contains filtered or unexported fields
}
QueryEncode URL query encoder structure
type UserLifeCyCle ¶
type UserLifeCyCle struct { *BaseResponse Result []struct { LifeCycle string `json:"lifecycle"` OpenTime string `json:"opentime"` } `json:"result"` }
生命周期
type UserOnOffRealSingle ¶
type UserOnOffRealSingle struct { *BaseResponse Result []struct { Status string `json:"status"` } `json:"result"` }
开关机状态
type UserStatusRealSingle ¶
type UserStatusRealSingle struct { *BaseResponse Result []struct { Status string `json:"STATUS"` } `json:"result"` }
卡状态
Click to show internal directories.
Click to hide internal directories.