Documentation
¶
Index ¶
- func FindExecutionNumber(logname string) int
- type ClockPayload
- type GoLog
- func (gv *GoLog) DefaultDecoder(buf []byte, payload interface{}) error
- func (gv *GoLog) DefaultEncoder(payload interface{}) ([]byte, error)
- func (gv *GoLog) DisableDebugMode()
- func (gv *GoLog) DisableLogging()
- func (gv *GoLog) EnableDebugMode()
- func (gv *GoLog) EnableLogging()
- func (gv *GoLog) GetCurrentVC() []byte
- func (gv *GoLog) GetCurrentVCAsClock() vclock.VClock
- func (gv *GoLog) LogLocalEvent(Message string) bool
- func (gv *GoLog) LogThis(Message string, ProcessID string, VCString string) bool
- func (gv *GoLog) PrepareSend(mesg string, buf interface{}) []byte
- func (gv *GoLog) SetEncoderDecoder(encoder func(interface{}) ([]byte, error), ...)
- func (gv *GoLog) UnpackReceive(mesg string, buf []byte, unpack interface{})
- func (gv *GoLog) WriteToFile(Message string) bool
- type GoPublisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindExecutionNumber ¶
Types ¶
type ClockPayload ¶
This is the data structure that is actually end on the wire
func (*ClockPayload) DecodeMsgpack ¶
func (d *ClockPayload) DecodeMsgpack(dec *msgpack.Decoder) error
Custom decoder function, needed for msgpack interoperability
func (*ClockPayload) EncodeMsgpack ¶
func (d *ClockPayload) EncodeMsgpack(enc *msgpack.Encoder) error
Custom encoder function, needed for msgpack interoperability
func (*ClockPayload) PrintDataBytes ¶
func (d *ClockPayload) PrintDataBytes()
Prints the Data Stuct as Bytes
func (*ClockPayload) PrintDataString ¶
func (d *ClockPayload) PrintDataString()
Prints the Data Struct as a String
type GoLog ¶
type GoLog struct {
//This bools Checks to send the VC Bundled with User Data on the Wire
// if False, PrepareSend and UnpackReceive will simply forward their input
//buffer to output and locally log event. If True, VC will be encoded into packet on wire
VConWire bool
// contains filtered or unexported fields
}
This is the Global Variable Struct that holds all the info needed to be maintained
func InitGoVector ¶
This is the Start Up Function That should be called right at the start of
a program
func InitGoVectorMultipleExecutions ¶
This is the Start Up Function That should be called right at the start of a program, without deleting the old log. It just increments the execution
func (*GoLog) DefaultDecoder ¶
func (*GoLog) DefaultEncoder ¶
func (*GoLog) DisableDebugMode ¶
func (gv *GoLog) DisableDebugMode()
func (*GoLog) DisableLogging ¶
func (gv *GoLog) DisableLogging()
func (*GoLog) EnableDebugMode ¶
func (gv *GoLog) EnableDebugMode()
func (*GoLog) EnableLogging ¶
func (gv *GoLog) EnableLogging()
func (*GoLog) GetCurrentVC ¶
func (*GoLog) GetCurrentVCAsClock ¶
func (*GoLog) LogLocalEvent ¶
func (*GoLog) PrepareSend ¶
This function is meant to be used immediately before sending. mesg will be logged along with the time of the send buf is encodeable data (structure or basic type) Returned is an encoded byte array with logging information
This function is meant to be called before sending a packet. Usually, it should Update the Vector Clock for its own process, package with the clock using msgpack and return the new byte array that should be sent onwards using the Send Command
func (*GoLog) SetEncoderDecoder ¶
func (*GoLog) UnpackReceive ¶
UnpackReceive is used to unmarshall network data into local structures mesg will be logged along with the vector time the receive happened buf is the network data, previously packaged by PrepareSend unpack is a pointer to a structure, the same as was packed by PrepareSend
This function is meant to be called immediately after receiving a packet. It unpacks the data by the program, the vector clock. It updates vector clock and logs it. and returns the user data
func (*GoLog) WriteToFile ¶
type GoPublisher ¶
type GoPublisher struct {
// contains filtered or unexported fields
}
func NewGoPublisher ¶
func NewGoPublisher(addr string, port string) *GoPublisher
Creates a GoPublisher and initiates a TCP-RPC connection that receives a nonce to identify the publisher when communicating with the broker.
func (*GoPublisher) PublishLocalMessage ¶
func (gp *GoPublisher) PublishLocalMessage(msg string, processID string, vclock vclock.VClock) error
Publish a local message to the broker
func (*GoPublisher) PublishNetworkMessage ¶
func (gp *GoPublisher) PublishNetworkMessage(msg string, processID string, vclock vclock.VClock) error
Publish a network message to the broker