ipify

module
v0.0.0-...-7e0cd83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2025 License: MIT

README

🌐 ipify API

Go Reference Official Documentation OpenAPI Go Report Card Code Coverage API Health

A simple public IP address API, easy to integrate into any application in seconds. (Source)

Installation

To install the library, use the following command:

go get github.com/go-api-libs/ipify/pkg/ipify

Usage

Example: Get you public IP address
package main

import (
	"context"

	"github.com/go-api-libs/ipify/pkg/ipify"
)

func main() {
	c, err := ipify.NewClient()
	if err != nil {
		panic(err)
	}

	ctx := context.Background()
	ipWrapper, err := c.GetIP(ctx, &ipify.GetIPParams{Format: "json"})
	if err != nil {
		panic(err)
	}

	// Use ipWrapper object
}

Additional Information

Contributing

If you have any contributions to make, please submit a pull request or open an issue on the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL