JGrossholtz / sdk-go

Official golang SDK for Kuzzle

Home Page:http://docs.kuzzle.io/sdk-reference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined

About

Kuzzle Go

This is the official Go SDK for the free and open-source backend Kuzzle. It provides a way to dial with a Kuzzle server from Go applications. The SDK provides a native WebSocket support. You can add your own network protocol by implementing the Protocol interface.

πŸ“š Documentation

Kuzzle

Kuzzle is a ready-to-use, on-premises and scalable backend that enables you to manage your persistent data and be notified in real-time on whatever happens to it. It also provides you with a flexible and powerful user-management system.

Usage

Installation

Simply download the SDK to your GOPATH.

go get github.com/kuzzleio/sdk-go

Example

The SDK supports different protocols. When instantiating, you must choose the protocol to use and fill in the different options needed to connect to Kuzzle.

package main

import (
	"fmt"

	"github.com/kuzzleio/sdk-go/kuzzle"
	"github.com/kuzzleio/sdk-go/protocol/websocket"
)

func main() {
	conn := websocket.NewWebSocket("localhost", nil)
	k, _ := kuzzle.NewKuzzle(conn, nil)
	k.Connect()

	timestamp, err := k.Server.Now(nil)

	if err != nil {
		fmt.Println(err.Error())
		return
	}

	fmt.Println(timestamp)
}

Contributing

First of all, thank you to take the time to contribute to this SDK. To help us validating your future pull request, please make sure your work pass linting and unit tests.

$ bash .ci/test_with_coverage.sh 

If you want to see current coverage run the script with this argument.

$ bash .ci/test_with_coverage.sh  --html

This should open a new tab in your favorite web browser and allow you to see the lines of code covered by the unit tests.

About

Official golang SDK for Kuzzle

http://docs.kuzzle.io/sdk-reference

License:Apache License 2.0


Languages

Language:Go 99.9%Language:Shell 0.1%