haiwai-common-sdk-go/services/ip/client.go
2025-06-30 14:59:37 +08:00

45 lines
911 B
Go

package ip
import (
"fmt"
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
)
const (
VERSION = "2025-06-24"
)
var HOST = requests.Host{
Default: "ip.gaore.com",
Func: func(s string, area string) string {
if area != "" {
fmt.Println("ip.gaore.com." + area)
return "ip.gaore.com." + area
}
return "ip.gaore.com.hk"
},
}
type Client struct {
sdk.Client
}
func NewClient(area string, env ...string) (client *Client, err error) {
client = new(Client)
err = client.InitWithArea(area, env...)
return
}
func (client *Client) CreateGetIpRequest(req *IpRequest) (resp *IpResponse, err error) {
resp = CreateIpResponse()
err = client.DoAction(req, resp)
return
}
func (client *Client) CreateGetIpsRequest(req *IpsRequest) (resp *IpsResponse, err error) {
resp = CreateIpsResponse()
err = client.DoAction(req, resp)
return
}