All Projects → koding → Kite

koding / Kite

Licence: mit
Micro-service framework in Go

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Kite

EasyTokenGenerator
This repo aims to dynamically and simply generate tokens in Token Based systems.
Stars: ✭ 15 (-99.52%)
Mutual labels:  authentication-backend
mangooio
An Intuitive, Lightweight, High Performance Full Stack Java Web Framework.
Stars: ✭ 52 (-98.33%)
Mutual labels:  web-framework
Doggy
Lightweight, idiomatic and stable for building Go 1.7+ HTTP services
Stars: ✭ 268 (-91.37%)
Mutual labels:  web-framework
flame
Ruby web-framework
Stars: ✭ 43 (-98.62%)
Mutual labels:  web-framework
kotlin-dropwizard
Getting Started with Dropwizard and Kotlin
Stars: ✭ 43 (-98.62%)
Mutual labels:  web-framework
tinyhttp
🦕 Deno port of tinyhttp, 0-legacy, tiny & fast web framework
Stars: ✭ 84 (-97.29%)
Mutual labels:  web-framework
shivneri
Component based MVC web framework based on fort architecture targeting good code structures, modularity & performance.
Stars: ✭ 21 (-99.32%)
Mutual labels:  web-framework
Firefly
Firefly is an asynchronous web framework for rapid development of high-performance web application.
Stars: ✭ 277 (-91.08%)
Mutual labels:  web-framework
rexsl
Java RESTful XSL-based Web Framework
Stars: ✭ 16 (-99.48%)
Mutual labels:  web-framework
Sihl
A modular functional web framework
Stars: ✭ 267 (-91.4%)
Mutual labels:  web-framework
Navigation
一款基于 Workerman 的 PHP Web 开发框架。
Stars: ✭ 20 (-99.36%)
Mutual labels:  web-framework
w4py
Webware for Python
Stars: ✭ 21 (-99.32%)
Mutual labels:  web-framework
Hunt Framework
A Web framework for D Programming Language. Full-stack high-performance.
Stars: ✭ 256 (-91.76%)
Mutual labels:  web-framework
Bukdu.jl
Bukdu 🌌 is a web development framework for Julia
Stars: ✭ 125 (-95.97%)
Mutual labels:  web-framework
Echox
Echo cookbook and website
Stars: ✭ 275 (-91.14%)
Mutual labels:  web-framework
geronimo-config
Apache Geronimo Config
Stars: ✭ 15 (-99.52%)
Mutual labels:  web-framework
fano
Pascal web application framework
Stars: ✭ 21 (-99.32%)
Mutual labels:  web-framework
Kemal
Fast, Effective, Simple Web Framework
Stars: ✭ 3,227 (+3.93%)
Mutual labels:  web-framework
Shio Rs
Shio is a fast, simple, and asynchronous micro web-framework for Rust.
Stars: ✭ 276 (-91.11%)
Mutual labels:  web-framework
Jupiter
Jupiter是斗鱼开源的面向服务治理的Golang微服务框架
Stars: ✭ 3,455 (+11.27%)
Mutual labels:  web-framework

Kite Micro-Service Framework

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

GoDoc Build Status

Kite

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: http://blog.gopheracademy.com/birthday-bash-2014/kite-microservice-library/

Install and Usage

Install the package with:

go get github.com/koding/kite

Import it with:

import "github.com/koding/kite"

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:

/<username>/<environment>/<name>/<version>/<region>/<hostname>/<id>
  • 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 github.com/koding/kite/kontrol/kontrol

Generate keys for the Kite key:

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

Set environment variables:

KONTROL_PORT=6000
KONTROL_USERNAME="kontrol"
KONTROL_STORAGE="etcd"
KONTROL_KONTROLURL="http://127.0.0.1:6000/kite"
KONTROL_PUBLICKEYFILE="certs/key_pub.pem"
KONTROL_PRIVATEKEYFILE="certs/key.pem"

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 "github.com/koding/kite"

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
	}).DisableAuthentication()

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

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

package main

import (
	"fmt"

	"github.com/koding/kite"
)

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

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

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

Check out the examples folder for more examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].