Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting Error when running exp2-watch.go from examples folder #228

Open
Shashwatsh opened this issue Dec 27, 2018 · 0 comments
Open

getting Error when running exp2-watch.go from examples folder #228

Shashwatsh opened this issue Dec 27, 2018 · 0 comments

Comments

@Shashwatsh
Copy link

I'm getting this error when running exp2-watch.go from examples folder

# github.com/Shashwatsh/kite_example
./exp2-watch.go:25:21: undefined: kite.Event
./exp2-watch.go:30:13: k.WatchKites undefined (type *kite.Kite has no field or method WatchKites)

full code


import (
        "fmt"
        "log"
        "math/rand"
        "time"

        "github.com/koding/kite"
        "github.com/koding/kite/config"
        "github.com/koding/kite/protocol"
)

func init() {
        rand.Seed(time.Now().UnixNano())
}

func main() {
        // Create a kite
        k := kite.New("exp2", "1.0.0")
        k.Config = config.MustGet()

        //k.Register(&url.URL{Scheme: "http", Host: "localhost:3636/kite"})

        onEvent := func(e *kite.Event, err *kite.Error) {
                fmt.Printf("e %+v\n", e)
                fmt.Printf("err %+v\n", err)
        }

        _, err := k.WatchKites(protocol.KontrolQuery{
                Username:    k.Config.Username,
                Environment: k.Config.Environment,
                Name:        "math",
                // ID: "48bb002b-79f6-4a4e-6bba-a40567a08b6c",
        }, onEvent)
        if err != nil {
                log.Fatalln(err)
        }

        // This is a bad example, it's just for testing the watch functionality :)
        fmt.Println("listening to events")

        select {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant