Work with ical formatted data in Go
This is partially a port of Data::ICal (perl5 module) to Go.
Parse an ics file:
import "github.com/lestrrat-go/ical"
// snip...
p := ical.NewParser()
c, err := p.ParseFile(file)
// snip
for e := range c.Entries() {
ev, ok := e.(*ical.Event)
if !ok {
continue
}
// work with event.
}
Programatically generate a Calendar
import "github.com/lestrrat-go/ical"
// snip...
c := ical.New()
c.AddProperty("X-Foo-Bar-Baz", "value")
tz := ical.NewTimezone()
tz.AddProperty("TZID", "Asia/Tokyo")
c.AddEntry(tz)
ical.NewEncoder(os.Stdout).Encode(c)
Version | Tag | Published |
---|---|---|
v0.0.0-20201229070544-61f83f92eaf4 | 1yr ago | |
v0.0.0-20190317233631-91af071bafbc | 3yrs ago | |
v0.0.0-20180221004145-fbfb9a8b4a93 | 3yrs ago |