mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
- Extract Invoice, Payment, Subscriber types and GetInvoices, GetPayments, GenerateInvoice methods to billing.go - Extract CarrierInfo, ConnectivityStatus, ProfileInfo types and carrier connector methods to carrier.go - Extract CreditCheckRequest/Response, CreditBalanceResponse types and charging engine methods to charging.go - Add PacketStats, CreditInfo types and GetPacketStats, GetCreditInfo
35 lines
831 B
Go
35 lines
831 B
Go
package api
|
|
|
|
// Packet Gateway Integration
|
|
type PacketStats struct {
|
|
IP uint64 `json:"ip"`
|
|
Bytes uint64 `json:"bytes"`
|
|
}
|
|
|
|
type PacketCreditInfo struct {
|
|
IP uint64 `json:"ip"`
|
|
Credit int64 `json:"credit"`
|
|
}
|
|
|
|
// GetPacketStats retrieves packet statistics
|
|
func (c *Client) GetPacketStats() ([]PacketStats, error) {
|
|
var resp struct {
|
|
Data []PacketStats `json:"data"`
|
|
}
|
|
if err := c.doGetJSON("/api/v1/packet-gateway/stats", &resp); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp.Data, nil
|
|
}
|
|
|
|
// GetPacketCreditInfo retrieves credit information from packet gateway
|
|
func (c *Client) GetPacketCreditInfo() ([]PacketCreditInfo, error) {
|
|
var resp struct {
|
|
Data []PacketCreditInfo `json:"data"`
|
|
}
|
|
if err := c.doGetJSON("/api/v1/packet-gateway/credits", &resp); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp.Data, nil
|
|
}
|