Skip to content
Michael Fulton edited this page Nov 5, 2015 · 19 revisions

User Manual

Setting Up A Go Workspace

The first thing you need to do is install golang. A guide for this can be found here: Getting Started With Go

Once you complete this tutorial, you should have a workspace directory for go, pointed to by $GOPATH. This directory should contain a src/, bin/, and pkg/. If they are not there, create them. Once golang is installed and you have this directory, with $GOPATH pointing to it, and $GOBIN pointing to the /bin directory within it, you are ready for the next step.

Acquiring This Code

Golang has a command-line tool 'go'. To acquire the necessary code, you're going to need to use go get which downloads and install packages and their dependencies. You'll need to run three of these:

go get github.com/garyburd/redigo/redis

go get github.com/gyuho/goraph/graph

go get github.com/Grissess/sdnd16/

Once you have done this, you should have the necessary code in your /src directory.

Building The Project

At this point, we need to build the code. You could build any of the test cases you wanted, but this guide will show building the client. You can do this by running

go install src/github.com/Grissess/sdnd16/client/client.go

Setting Up A Redis Database

LEFT FOR DAVID

Writing A Topology File

To use the client, you're going to need a topology file. You can write one of these very easily yourself. Simply write a text file with the following form describing each edge:src dst cost where src is the label for the source node, dst is the label for the destination (both strings of any kind), and cost is a positive integer representing a cost, with tabs separating them all.

Running the Client

To run the built client, run ./bin/client

You will be given two options: store or grab. Storing is the process of putting a topology into the database, grab allows you to get information from a topology you have stored in the database.

When storing, you be asked for a file name for a topology file, a name for this database record, and a ip address and port number for a database. To store a topology, enter the name of the file containing it, give a memorable name, and the ip address and port of your redis database (on localhost if that's where your database is).

When grabbing, you will be asked for the name of a topology record in the database, and the address/port number for the database it is stored on. After this, you will be asked for the labels of two nodes, and you will then be responded to with the shortest path between these two nodes, and the total cost. This process will then loop until Ctrl+C'd.

Notes And Troubleshooting.

Further functionality will be added soon, and this document will be updated. If you need any help of any kind, please email fultonms@clarkson.edu, or submit an issue on this repository.

Clone this wiki locally