Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPListParams ¶
type IPListParams struct { // Specified as `jdcloud` to list IPs used by JD Cloud data centers. Networks param.Field[string] `query:"networks"` }
func (IPListParams) URLQuery ¶
func (r IPListParams) URLQuery() (v url.Values)
URLQuery serializes IPListParams's query parameters as `url.Values`.
type IPListResponse ¶
type IPListResponse interface {
// contains filtered or unexported methods
}
Union satisfied by ips.IPs or ips.JDCloudIPs.
type IPListResponseEnvelope ¶
type IPListResponseEnvelope struct { Errors []IPListResponseEnvelopeErrors `json:"errors,required"` Messages []IPListResponseEnvelopeMessages `json:"messages,required"` Result IPListResponse `json:"result,required"` // Whether the API call was successful Success IPListResponseEnvelopeSuccess `json:"success,required"` JSON ipListResponseEnvelopeJSON `json:"-"` }
func (*IPListResponseEnvelope) UnmarshalJSON ¶
func (r *IPListResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type IPListResponseEnvelopeErrors ¶
type IPListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ipListResponseEnvelopeErrorsJSON `json:"-"` }
func (*IPListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *IPListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type IPListResponseEnvelopeMessages ¶
type IPListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ipListResponseEnvelopeMessagesJSON `json:"-"` }
func (*IPListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *IPListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type IPListResponseEnvelopeSuccess ¶
type IPListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
IPListResponseEnvelopeSuccessTrue IPListResponseEnvelopeSuccess = true
)
type IPService ¶
type IPService struct {
Options []option.RequestOption
}
IPService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIPService method instead.
func NewIPService ¶
func NewIPService(opts ...option.RequestOption) (r *IPService)
NewIPService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IPService) List ¶
func (r *IPService) List(ctx context.Context, query IPListParams, opts ...option.RequestOption) (res *IPListResponse, err error)
Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.
type IPs ¶
type IPs struct { // A digest of the IP data. Useful for determining if the data has changed. Etag string `json:"etag"` // List of Cloudflare IPv4 CIDR addresses. IPV4CIDRs []string `json:"ipv4_cidrs"` // List of Cloudflare IPv6 CIDR addresses. IPV6CIDRs []string `json:"ipv6_cidrs"` JSON ipsJSON `json:"-"` }
func (*IPs) UnmarshalJSON ¶
type JDCloudIPs ¶
type JDCloudIPs struct { // A digest of the IP data. Useful for determining if the data has changed. Etag string `json:"etag"` // List of Cloudflare IPv4 CIDR addresses. IPV4CIDRs []string `json:"ipv4_cidrs"` // List of Cloudflare IPv6 CIDR addresses. IPV6CIDRs []string `json:"ipv6_cidrs"` // List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used. JDCloudCIDRs []string `json:"jdcloud_cidrs"` JSON JDCloudIPsJSON `json:"-"` }
func (*JDCloudIPs) UnmarshalJSON ¶
func (r *JDCloudIPs) UnmarshalJSON(data []byte) (err error)
type JDCloudIPsJSON ¶
type JDCloudIPsJSON struct { Etag apijson.Field IPV4CIDRs apijson.Field IPV6CIDRs apijson.Field JDCloudCIDRs apijson.Field ExtraFields map[string]apijson.Field // contains filtered or unexported fields }
JDCloudIPsJSON contains the JSON metadata for the struct JDCloudIPs
func (JDCloudIPsJSON) RawJSON ¶
func (r JDCloudIPsJSON) RawJSON() string