Add sync => go-sync

This commit is contained in:
Asim Aslam
2019-05-31 00:43:23 +01:00
parent 4035ab5c7b
commit 95d134b57e
28 changed files with 2192 additions and 0 deletions

27
sync/event/event.go Normal file
View File

@@ -0,0 +1,27 @@
// Package event provides a distributed log interface
package event
// Event provides a distributed log interface
type Event interface {
// Log retrieves the log with an id/name
Log(id string) (Log, error)
}
// Log is an individual event log
type Log interface {
// Close the log handle
Close() error
// Log ID
Id() string
// Read will read the next record
Read() (*Record, error)
// Go to an offset
Seek(offset int64) error
// Write an event to the log
Write(*Record) error
}
type Record struct {
Metadata map[string]interface{}
Data []byte
}