gog

command module
v0.0.0-...-831f302 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

README

gog

Gossip Over Gophers

![GoDoc] (https://godoc.org/github.com/go-distributed/gog?status.png)

[Writeup] (https://drive.google.com/file/d/0BzkE2qUvDHtpTFdZRVFCWDI0dWM/view?usp=sharing)

###How to build:

$ go build

Show usage:

$ ./gog -h

Run a standalone node:

$ ./gog

To join an existing cluster:

  1. Form a two-node-cluster

    $ ./gog -addr="localhost:8000" -rest-addr="localhost:8001"
    $ ./gog -addr="localhost:8002" -rest-addr="localhost:8003"
    
  2. Let the first node join the second node

    $ curl http://localhost:8001/api/join -d peer=localhost:8002
    
  3. Show the view in the first node

    $ curl http://localhost:8001/api/list
    {"active_view":[{"id":"localhost:8002","address":"localhost:8002"}],"passive_view":[]}
    

You can also provide a json file contains a list of nodes:

$ cat peers.json
["localhost:8000", "localhost:8001", "localhost:8002", "localhost:8003"]

$ curl -d @peers.json -H "Content-Type: application/json" http://localhost:8001/api/join

To broadcast a message:

$ curl http://localhost:8001/api/broadcast -d message=hello

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package message is a generated protocol buffer package.
Package message is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL