Skip to content

ghatdev/PostBird

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages