Initial commit
This commit is contained in:
commit
2b72492a59
25 changed files with 3147 additions and 0 deletions
23
plugin/plugin.go
Normal file
23
plugin/plugin.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Command plugin is the happyDomain plugin entrypoint for the authoritative-consistency
|
||||
// checker. It is built as a Go plugin (`go build -buildmode=plugin`) and
|
||||
// loaded at runtime by happyDomain.
|
||||
package main
|
||||
|
||||
import (
|
||||
chk "git.happydns.org/checker-authoritative-consistency/checker"
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
)
|
||||
|
||||
// Version is the plugin's version. It defaults to "custom-build" and is
|
||||
// meant to be overridden by the CI at link time:
|
||||
//
|
||||
// go build -buildmode=plugin -ldflags "-X main.Version=1.2.3" -o checker-chk.so ./plugin
|
||||
var Version = "custom-build"
|
||||
|
||||
// NewCheckerPlugin is the symbol resolved by happyDomain when loading the
|
||||
// .so file.
|
||||
func NewCheckerPlugin() (*sdk.CheckerDefinition, sdk.ObservationProvider, error) {
|
||||
chk.Version = Version
|
||||
prvd := chk.Provider()
|
||||
return prvd.(sdk.CheckerDefinitionProvider).Definition(), prvd, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue