Browse Source

string func for DNSUpdateAction

Matthew R Kasun 2 years ago
parent
commit
71f41fefb8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      models/dnsEntry.go

+ 4 - 0
models/dnsEntry.go

@@ -17,6 +17,10 @@ const (
 	DNSInsert
 	DNSInsert
 )
 )
 
 
+func (action DNSUpdateAction) String() string {
+	return [...]string{"DNSDeleteByIP", "DNSDeletByName", "DNSReplaceName", "DNSReplaceIP", "DNSInsert"}[action]
+}
+
 // DNSUpdate data for updating entries in /etc/hosts
 // DNSUpdate data for updating entries in /etc/hosts
 type DNSUpdate struct {
 type DNSUpdate struct {
 	Action     DNSUpdateAction
 	Action     DNSUpdateAction