-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search records when id is not provided (#3)
* update example and add example to _example/ * update libdns * major rewrite: - clear separation of provider and ionos-client part - delete, update now also work when no record id is provided - restructured tests * delete all found records when no id is provided * add and test delete safety check
- Loading branch information
1 parent
b9bdfa3
commit f9501ae
Showing
8 changed files
with
532 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.envrc | ||
_gitignore/ | ||
*~ | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/libdns/ionos" | ||
) | ||
|
||
func main() { | ||
token := os.Getenv("LIBDNS_IONOS_TOKEN") | ||
if token == "" { | ||
panic("LIBDNS_IONOS_TOKEN not set") | ||
} | ||
|
||
zone := os.Getenv("LIBDNS_IONOS_ZONE") | ||
if zone == "" { | ||
panic("LIBDNS_IONOS_ZONE not set") | ||
} | ||
|
||
p := &ionos.Provider{ | ||
AuthAPIToken: token, | ||
} | ||
|
||
records, err := p.GetRecords(context.TODO(), zone) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
out, _ := json.MarshalIndent(records, "", " ") | ||
fmt.Println(string(out)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/libdns/ionos | ||
|
||
go 1.16 | ||
go 1.18 | ||
|
||
require github.com/libdns/libdns v0.2.1 | ||
require github.com/libdns/libdns v0.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github.com/libdns/libdns v0.2.1 h1:Wu59T7wSHRgtA0cfxC+n1c/e+O3upJGWytknkmFEDis= | ||
github.com/libdns/libdns v0.2.1/go.mod h1:yQCXzk1lEZmmCPa857bnk4TsOiqYasqpyOEeSObbb40= | ||
github.com/libdns/libdns v0.2.2 h1:O6ws7bAfRPaBsgAYt8MDe2HcNBGC29hkZ9MX2eUSX3s= | ||
github.com/libdns/libdns v0.2.2/go.mod h1:4Bj9+5CQiNMVGf87wjX4CY3HQJypUHRuLvlsfsZqLWQ= |
Oops, something went wrong.