Skip to content

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

Description

@Shashwatsh

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 {}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions