1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
Files
stackexchange-dnscontrol/pkg/dnsgraph/graphable.go

37 lines
551 B
Go
Raw Normal View History

package dnsgraph
type NodeType uint8
const (
Change NodeType = iota
Report
)
type DependencyType uint8
const (
ForwardDependency DependencyType = iota
BackwardDependency
)
type Dependency struct {
NameFQDN string
Type DependencyType
}
type Graphable interface {
GetType() NodeType
GetName() string
GetDependencies() []Dependency
}
func GetRecordsNamesForGraphables[T Graphable](graphables []T) []string {
var names []string
for _, graphable := range graphables {
names = append(names, graphable.GetName())
}
return names
}