command
Version:
v0.0.4
Opens a new window with list of versions in this module.
Published: Jan 13, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
go-cloudip Example
This example demonstrates the core features of the go-cloudip library.
Running the Example
cd example
go run main.go
What This Example Shows
- Simple Provider Detection - Using
GetProvider() and IsCloudProvider() to identify cloud IPs
- Provider-Specific Checks - Using
IsAWS(), IsGCP(), IsCloudflare(), etc.
- Detailed Lookup - Using
Lookup() to get full information (region, service, CIDR)
- Data Metadata - Viewing version, range count, and supported providers
- Custom Detector - Creating a detector with custom cache directory and auto-update
- Update Check - Checking if newer data is available
Sample Output
=== go-cloudip Example ===
1. Simple Provider Detection
-----------------------------
52.94.76.1 -> Provider: aws IsCloud: true
34.64.0.1 -> Provider: gcp IsCloud: true
104.16.0.1 -> Provider: cloudflare IsCloud: true
1.1.1.1 -> Provider: cloudflare IsCloud: true
192.168.1.1 -> Provider: unknown IsCloud: false
8.8.8.8 -> Provider: gcp IsCloud: true
2. Provider-Specific Checks
---------------------------
52.94.76.1:
IsAWS: true
IsGCP: false
IsCloudflare: false
...
More Examples
For advanced usage patterns, see the main package documentation.
Documentation
¶
Package main demonstrates the usage of the go-cloudip library.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.