dnscontrol/pkg/dnsgraph/graphable.go
Vincent Hagen e32bdc053f
NEW FEATURE: Order changes based on the record dependencies (#2419)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
2023-08-29 14:00:09 -04:00

36 lines
551 B
Go

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
}