freemyip

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MPL-2.0 Imports: 10 Imported by: 7

README

Go library for accessing the freemyip.com API

Build Status PkgGoDev Go Report Card

An freemyip.com API client written in Go.

freemyip is a Go client library for accessing the freemyip.com API.

Examples

package main

import (
	"context"
	"fmt"

	"github.com/nrdcg/freemyip"
)

func main() {
	client := freemyip.New("secret", true)

	ctx := context.Background()

	resp, err := client.UpdateDomain(ctx, "example", "")
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}

API Documentation

Documentation

Overview

Package freemyip contains a client of the DNS API of freemyip.

Index

Constants

View Source
const RootDomain = "freemyip.com"

RootDomain the root domain of all domains.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client an API client for freemyip.

func New

func New(token string, verbose bool) *Client

New creates a new Client.

func (Client) DeleteDomain

func (c Client) DeleteDomain(ctx context.Context, domain string) (string, error)

DeleteDomain deletes a domain.

  • `domain` is the custom part of the real domain. (ex: `YOUR_DOMAIN` in `YOUR_DOMAIN.freemyip.com`)

func (Client) DeleteTXTRecord

func (c Client) DeleteTXTRecord(ctx context.Context, domain string) (string, error)

DeleteTXTRecord delete a TXT record for a domain.

  • `domain` is the custom part of the real domain. (ex: `YOUR_DOMAIN` in `YOUR_DOMAIN.freemyip.com`)
  • `value` is the TXT record content.

func (Client) EditTXTRecord

func (c Client) EditTXTRecord(ctx context.Context, domain, value string) (string, error)

EditTXTRecord creates or updates a TXT record value for a domain.

  • `domain` is the custom part of the real domain. (ex: `YOUR_DOMAIN` in `YOUR_DOMAIN.freemyip.com`)
  • `value` is the TXT record content.

func (Client) UpdateDomain

func (c Client) UpdateDomain(ctx context.Context, domain, myIP string) (string, error)

UpdateDomain updates a domain.

  • `domain` is the custom part of the real domain. (ex: `YOUR_DOMAIN` in `YOUR_DOMAIN.freemyip.com`)
  • `myIP` is optional.

Jump to

Keyboard shortcuts

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