Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 1.11 KB

README.md

File metadata and controls

62 lines (50 loc) · 1.11 KB

Build Status

PostBird

Easy communication library for Golang

Usage

Quick Start

Run this command in bash or cmd or etc..

go get github.com/ghatdev/postbird

And, add this line

import "github.com/ghatdev/PostBird"

in your code

How to use

  • Server Mode:

    • Call RegisterFunc() to register functions.
    • Call StartServer() to start the server.
  • Client Mode:

    • Call ConnectToRemote() to connect to server.
    • Call CallRemoteFunc() to call registered functions.
    • call RegisterFunc() to register functions..

Example

  • As Server :
package main

import (
  	"PostBird"
  	"fmt"
)

func main() {
  	postbird.RegisterFunc("test", test)
  	postbird.SetBindAddress("0.0.0.0")
  	postbird.StartServer(0)

}

func test(a string) {
  	fmt.Println(a)
}
  • As Client :
package main

import "PostBird"

func main() {
  	postbird.ConnectToRemote(0)
  	postbird.CallRemoteFunc("test", "Hello World!")
}
  • Result (Server Prompt):
    Hello World!