Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Micro-service framework in Go
Go Python Makefile SQLPL
Branch: master

Merge pull request #135 from leeola/newwithouthandlers

kontrol: Added NewWithoutHandlers func
latest commit 9543bb3a8c
@cihangir cihangir authored
Failed to load latest commit information.
config config: add KITE_TRANSPORT env config
dnode dnode/partial: checking is done in Unmarshall() already
examples example: update math example so we can test several transports
kitectl kitectl: enable xhr for query, better in terms of compatilibility
kitekey kite: fix jwt which broke API compability with 2.x version
kontrol Merge pull request #135 from leeola/newwithouthandlers
protocol kontrol: test mockup deletion in travis
reverseproxy reverseproxy: fix reverseproxy code
sockjsclient sockjsclient: revert again as the public api was reverted
systeminfo systeminfo: add basic disk/memory collection openbsd
test test: fix kontrolclient test
testkeys kontrol: add multiple key test
testutil kontrol: unify and fix test for key renew
tunnelproxy tunnelproxy: fix tests
utils utils: new helper package for registiration purposes
.gitignore kitectl: Use
.travis.yml travis: use new infra
LICENSE add MIT license
Makefile Makefile: build again etcd from the source Merge pull request #94 from techjanitor/master
client.go Kite: remove debug log
errors.go kite/errors: better error string
handlers.go Change go crypto package from to
heartbeat.go Kite: fix typo
kite.go Kite: change read lock to write lock
kite_test.go Kite: remove debug log
kontrolclient.go kontrolclient: remove 1.4 only syntax
logger.go kite/logger: fix set level
method.go method: improve throttle
method_test.go method: improve throttle
registerurl.go kite: add new RegisterURL() method for easy register URLs
request.go Kite: lock kite while setting it…
server.go add Kite.Port() method
tokenrenewer.go kontrol: add multiple key test

Kite Micro-Service Framework

Kite is a framework for developing micro-services in Go.

GoDoc Build Status


Kite is both the name of the framework and the micro-service that is written by using this framework. Basically, Kite is a RPC server as well as a client. It connects to other kites and peers to communicate with each other. They can discover other kites using a service called Kontrol, and communicate with them bidirectionaly. The communication protocol uses a WebSocket (or XHR) as transport in order to allow web applications to connect directly to kites.

Kites can talk with each other by sending dnode messages over a socket session. If the client knows the URL of the server kite it can connect to it directly. If the URL is not known, client can ask for it from Kontrol (Service Discovery).

For more info checkout the blog post at GopherAcademy which explains Kite in more detail:

Install and Usage

Install the package with:

go get

Import it with:

import ""

and use kite as the package name inside the code.

What is Kontrol?

Kontrol is the service registry and authentication service used by Kites. It is itself a kite too.

When a kite starts to run, it can registers itself to Kontrol with the Register() method if wished. That enables others to find it by querying Kontrol. There is also a Proxy Kite for giving public URLs to registered kites.

Query has 7 fields:

  • You must at least give the username.
  • The order of the fields is from general to specific.
  • Query cannot contains empty parts between fields.

Installing Kontrol

Install Kontrol:

go get

Generate keys for the Kite key:

openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -pubout > key_pub.pem

Set environment variables:


Generate initial Kite key:

./bin/kontrol -initial

How can I use kites from a browser?

A browser can also be a Kite. It has it's own methods ("log" for logging a message to the console, "alert" for displaying alert to the user, etc.). A connected kite can call methods defined on the webpage.

See kite.js library for more information.

How can I write a new kite?

  • Import kite package.
  • Create a new instance with kite.New().
  • Add your method handlers with k.HandleFunc() or k.Handle().
  • Call k.Run()

Below you can find an example, a math kite which calculates the square of a received number:

package main

import ""

func main() {
    // Create a kite
    k := kite.New("math", "1.0.0")

    // Add our handler method with the name "square"
    k.HandleFunc("square", func(r *kite.Request) (interface{}, error) {
        a := r.Args.One().MustFloat64()
        result := a * a    // calculate the square
        return result, nil // send back the result

    // Attach to a server with port 3636 and run it
    k.Config.Port = 3636

Now let's connect to it and send a 4 as an argument.

package main

import (


func main() {
    k := kite.New("exp2", "1.0.0")

    // Connect to our math kite
    mathWorker := k.NewClient("http://localhost:3636/kite")

    response, _ := mathWorker.Tell("square", 4) // call "square" method with argument 4
    fmt.Println("result:", response.MustFloat64())

Check out the examples folder for more examples.

Something went wrong with that request. Please try again.