Add basic operations

This commit is contained in:
Glenn Y. Rolland 2021-06-25 14:46:25 +02:00
parent e22e4f9237
commit aacd6faba0
5 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,39 @@
package main
import (
"fmt"
"io/ioutil"
ics "github.com/PuloV/ics-golang"
_ "github.com/mattn/go-sqlite3/driver"
)
func assertOk(e error) {
if e != nil {
panic(e)
}
}
func main() {
fmt.Println("Hello world")
icsBytes, err := ioutil.ReadFile("example.ics")
assertOk(err)
// start, end := time.Now(), time.Now().Add(12*30*24*time.Hour)
parser := ics.New()
parser.Load(string(icsBytes))
_, err = parser.GetErrors()
assertOk(err)
calendars, err := parser.GetCalendars()
assertOk(err)
events := calendars[0].GetEvents()
for _, e := range events {
fmt.Printf("%#v\n", e)
// fmt.Printf("%s on %s by %s\n", e.Summary, e.Start, e.Organizer.Cn)
}
// fmt.Print(string(f))
}

0
pkg/kiwimix/substract.go Normal file
View file

0
pkg/kiwimix/union.go Normal file
View file

1
pkg/kiwimix/version.go Normal file
View file

@ -0,0 +1 @@
package kiwimix