fix: test all endpoints and responses
This commit is contained in:
parent
8c8b86bfa0
commit
32575babdb
1 changed files with 4 additions and 4 deletions
|
@ -294,8 +294,8 @@ func (c *Client) Reports(ctx context.Context, ip net.IP, opts *ReportsOptions) (
|
||||||
type BlacklistOptions struct {
|
type BlacklistOptions struct {
|
||||||
ConfidenceMinimum int `json:"confidenceMinimum,omitempty"`
|
ConfidenceMinimum int `json:"confidenceMinimum,omitempty"`
|
||||||
Limit int `json:"limit,omitempty"`
|
Limit int `json:"limit,omitempty"`
|
||||||
OnlyCountries []string `json:"onlyCountries,omitempty"`
|
OnlyCountries []string `json:"onlyCountries,omitempty"` // does not work?
|
||||||
ExceptCountries []string `json:"exceptCountries,omitempty"`
|
ExceptCountries []string `json:"exceptCountries,omitempty"` // seems to work
|
||||||
IpVersion int `json:"ipVersion,omitempty"`
|
IpVersion int `json:"ipVersion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,14 +445,14 @@ type CheckBlockResult struct {
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) CheckBlock(ctx context.Context, ipnNet net.IPNet, opts *CheckBlockOptions) (*CheckBlockResult, error) {
|
func (c *Client) CheckBlock(ctx context.Context, ipnNet *net.IPNet, opts *CheckBlockOptions) (*CheckBlockResult, error) {
|
||||||
var endpoint = "check-block"
|
var endpoint = "check-block"
|
||||||
|
|
||||||
network := html.EscapeString(ipnNet.String())
|
network := html.EscapeString(ipnNet.String())
|
||||||
parameters := map[string]string{
|
parameters := map[string]string{
|
||||||
"network": network,
|
"network": network,
|
||||||
}
|
}
|
||||||
// TODO check network
|
|
||||||
if opts != nil {
|
if opts != nil {
|
||||||
if opts.MaxAgeInDays > 0 && opts.MaxAgeInDays <= 365 {
|
if opts.MaxAgeInDays > 0 && opts.MaxAgeInDays <= 365 {
|
||||||
parameters["maxAgeInDays"] = strconv.Itoa(opts.MaxAgeInDays)
|
parameters["maxAgeInDays"] = strconv.Itoa(opts.MaxAgeInDays)
|
||||||
|
|
Loading…
Reference in a new issue