Skip to content

libdns/thelittlehost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Little Host for libdns

Go Reference

This package implements the libdns interfaces for The Little Host, allowing you to manage DNS records programmatically.

Configuration

provider := &thelittlehost.Provider{
    APIToken: "tlh_your_api_token_here",
}

Fields

Field Type Required Description
APIToken string Yes Bearer token for API authentication. Generate one in the The Little Host control panel. Tokens are prefixed with tlh_.

Environment variables

This package does not read environment variables directly. Set struct fields explicitly, or use environment variables as defaults in your application:

provider := &thelittlehost.Provider{
    APIToken: os.Getenv("THELITTLEHOST_API_TOKEN"),
}

Usage with CertMagic / Caddy

import "github.com/libdns/thelittlehost"

provider := &thelittlehost.Provider{
    APIToken: "tlh_...",
}

In Caddy JSON config:

{
  "module": "thelittlehost",
  "api_token": "tlh_..."
}

Caveats

  • MX records: Priority is encoded in the Data field as "<preference> <target>" per the libdns convention and is split out for the API automatically.
  • DeleteRecords wildcards: Empty Type, TTL, or Data fields on an input record act as wildcards — any existing record matching the non-empty fields will be deleted.
  • Concurrency: All methods are safe for concurrent use.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages