Skip to content

Commit 3025628

Browse files
Small documentation updates
1 parent 83ad5ca commit 3025628

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

README.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ GoVector is compatible with Go 1.4+
2727
* govec/ : Contains the Library and all its dependencies
2828
* example/ : Contains some examples instrumented with different features of GoVector
2929

30-
### Usage
30+
### Installation
3131

32-
To use GoVector you must have a correctly configured go development
32+
To install GoVector you must have a correctly configured go development
3333
environment, see [How to write Go
3434
Code](https://golang.org/doc/code.html)
3535

@@ -41,14 +41,7 @@ tool command:
4141
*gofmt* will automatically add imports for GoVector. If you do not
4242
have a working version of *gofmt* GoVector can be imported by adding:
4343

44-
See GoVectors library documentation
45-
[here](https://godoc.org/github.com/DistributedClocks/GoVector/govec).
46-
47-
- [ ] Write up priority example
48-
- [ ] Simple write up partial ordering
49-
- [ ] Write up limitations 1 process per machine
50-
51-
### Examples
44+
### Usage
5245

5346
The following is a basic example of how this library can be used
5447
```go
@@ -57,29 +50,30 @@ The following is a basic example of how this library can be used
5750
import "github.com/DistributedClocks/GoVector/govec"
5851

5952
func main() {
53+
//Initialize GoVector logger
6054
Logger := govec.InitGoVector("MyProcess", "LogFile")
6155

62-
//In Sending Process
63-
64-
//Prepare a Message
56+
//Encode message, and update vector clock
6557
messagepayload := []byte("samplepayload")
66-
finalsend := Logger.PrepareSend("Sending Message", messagepayload)
58+
vectorclockmessage := Logger.PrepareSend("Sending Message", messagepayload)
6759

6860
//send message
69-
connection.Write(finalsend)
61+
connection.Write(vectorclockmessage)
7062

7163
//In Receiving Process
72-
73-
//receive message
74-
recbuf := Logger.UnpackReceive("Receiving Message", finalsend)
64+
connection.Read(vectorclockmessage)
65+
//Decode message, and update local vector clock with received clock
66+
Logger.UnpackReceive("Receiving Message", &messagepayload, vectorclockmessage)
7567

76-
//Can be called at any point
68+
//Log a local event
7769
Logger.LogLocalEvent("Example Complete")
78-
79-
Logger.DisableLogging()
80-
//No further events will be written to log file
8170
}
8271
```
72+
For complete documentation and examples see GoVectors [GoDoc](https://godoc.org/github.com/DistributedClocks/GoVector/govec),
73+
74+
### Motivation
75+
76+
### Output
8377

8478
This produces the log "LogFile.txt" :
8579

0 commit comments

Comments
 (0)