Add basic operations
This commit is contained in:
parent
e22e4f9237
commit
aacd6faba0
5 changed files with 40 additions and 0 deletions
|
@ -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
0
pkg/kiwimix/substract.go
Normal file
0
pkg/kiwimix/union.go
Normal file
0
pkg/kiwimix/union.go
Normal file
1
pkg/kiwimix/version.go
Normal file
1
pkg/kiwimix/version.go
Normal file
|
@ -0,0 +1 @@
|
|||
package kiwimix
|
Loading…
Reference in a new issue