Coder Social home page Coder Social logo

shdriesner / sample-rpc-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cirocosta/sample-rpc-go

0.0 0.0 0.0 11 KB

An Example of Go RPC Client and Server

Home Page: https://ops.tips/gists/example-go-rpc-client-and-server/

Makefile 4.02% Go 95.98%

sample-rpc-go's Introduction

        DESCRIPTION

                sample-rpc-go provides an example of a client-server
                communication making use of `net/rpc` and `net/rpc/jsonrpc`.

                Both client and server are meant to be run using a single
                binary - to run a server, turn the `-server` flag on:

                        ./main -server

                There are three modes supported:

                        - default:      binary RPC (encoding/gob) via pure TCP
                        - http:         binary RPC (encoding/god) via HTTP
                        - json:         JSON-RPC (1.0) via TCP

                These modes are meant to be used together (server and client should
                be on the same mode) and can be activated with the respective flags.


        USAGE

                ./main --help
                Usage of ./main:
                  -http
                        whether it should use HTTP
                  -json
                        whether it should use json-rpc
                  -port uint
                        port to listen or connect to for rpc calls (default 1337)
                  -server
                        activates server mode


        HACK

                # Produce a binary called `main` in the repository root
                make build

                # Format
                make fmt

sample-rpc-go's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.