Skip to content

devhsoj/ik

Repository files navigation

ik

ik (short for intānettokomando) is a simple, high performance, event-oriented TCP protocol & library.

Features

  • Zero Dependencies!
  • Request / Response
  • Streaming

Getting Started

go get github.com/devhsoj/ik

More examples can be found in examples/

Server Example:

package main

import "github.com/devhsoj/ik"

func main() {
    server := ik.NewServer()
    
    server.Register("echo", func(c *ik.ServerClient, data []byte) []byte {
        return data
    })

    if err := server.Listen(":3000"); err != nil {
        panic(err)
    }
}

Client Example:

package main

import (
    "fmt"
    "github.com/devhsoj/ik"
)

func main() {
    client := ik.NewClient(&ik.ClientOptions{
        Addr: "localhost:3000",
    })

    res, err := client.Send("echo", []byte("Hello, world!"))

    if err != nil {
        panic(err)
    }

    fmt.Println(string(res)) // Hello, world!
}

About

a simple, high performance, event-oriented TCP protocol & library.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages