https://github.com/matthiasng/libdnsfactory
libdns provider factory
https://github.com/matthiasng/libdnsfactory
dns golang libdns libdns-providers
Last synced: 5 months ago
JSON representation
libdns provider factory
- Host: GitHub
- URL: https://github.com/matthiasng/libdnsfactory
- Owner: matthiasng
- License: mit
- Created: 2020-10-20T18:18:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-29T10:36:46.000Z (almost 5 years ago)
- Last Synced: 2025-01-28T17:40:51.564Z (over 1 year ago)
- Topics: dns, golang, libdns, libdns-providers
- Language: Go
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
libdnsfactory
=============
[](https://pkg.go.dev/github.com/matthiasng/libdnsfactory)
With `libdnsfactory`, you can create libdns providers by name.
This allows you to support all providers in a dynamic way. For example, if you want to let the user decide which provider to use with which configuration.
The [factory](https://github.com/matthiasng/libdnsfactory/blob/master/factory.go) and [docs](https://github.com/matthiasng/libdnsfactory/blob/master/docs.md) are [generated](https://github.com/matthiasng/libdnsfactory/blob/master/generate/main.go) from the provider repositories.
# Install
```sh
go get -u github.com/matthiasng/libdnsfactory
```
# Example
```go
package main
import (
"fmt"
"github.com/matthiasng/libdnsfactory"
)
func main() {
name := "hetzner"
configMap := map[string]string{
"AuthAPIToken": "",
}
provider, err := libdnsfactory.NewProvider(name, configMap)
if err != nil {
panic(err)
}
records, err := provider.AppendRecords(...)
if err != nil {
panic(err)
}
fmt.Println(records)
}
```
# Dev
To update an existing provider or add a new one, run `go get -u github.com/libdns/...` and `go run ./generate`.