-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmlencoder.go
31 lines (25 loc) · 937 Bytes
/
xmlencoder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"encoding/xml"
"fmt"
"github.com/dasfoo/gmail-filters/filter"
)
func main() {
v := filter.NewFeed()
v.AddAuthor("Ivan Ivanov", "[email protected]")
v.Personal([]string{"Ivan", "Ivanov"},
[]string{"ivan.ivanov", "ivanov", "iv"})
v.Environment("go.example.com", "kafka.example.com")
v.Entertainment("english.example.com", "shopping.example.com")
v.Review("Projectlabel", "projectname", "it is interesting", "extrareview.example.com", "plusrev.example.com")
v.Project("Gmaillabel", "GmailFilters", true)
v.Project("projectlabel", "DasFoo", false)
v.Service("Service", "service1.example.com", "service2.example.com")
v.AutomatedSystem("auto", "[email protected]", "[email protected]")
output, err := xml.MarshalIndent(v, " ", " ")
if err != nil {
fmt.Printf("error: %v\n", err)
}
fmt.Println(xml.Header + string(output))
}