-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Mills
committed
Jan 30, 2025
1 parent
21485e9
commit b4e8716
Showing
4 changed files
with
45 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -16,6 +16,8 @@ _testmain.go | |
*.exe~ | ||
*.test | ||
*.prof | ||
**/.envrc | ||
**/.DS_Store | ||
|
||
# Tests 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
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 @@ | ||
//go:build libdns_gcore || !libdns_separate | ||
// +build libdns_gcore !libdns_separate | ||
|
||
package libdns | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/foxcpp/maddy/framework/config" | ||
"github.com/foxcpp/maddy/framework/module" | ||
"github.com/libdns/gcore" | ||
) | ||
|
||
func init() { | ||
module.Register("libdns.gcore", func(modName, instName string, _, _ []string) (module.Module, error) { | ||
p := gcore.Provider{} | ||
return &ProviderModule{ | ||
RecordDeleter: &p, | ||
RecordAppender: &p, | ||
setConfig: func(c *config.Map) { | ||
c.String("api_key", false, false, "", &p.APIKey) | ||
}, | ||
afterConfig: func() error { | ||
if p.APIKey == "" { | ||
return fmt.Errorf("libdns.gcore: api_key should be specified") | ||
} | ||
return nil | ||
}, | ||
|
||
instName: instName, | ||
modName: modName, | ||
}, nil | ||
}) | ||
} |