MCPcopy
hub / github.com/ha/doozerd / New

Function New

src/pkg/store/store.go:87–107  ·  view source on GitHub ↗

Creates a new, empty data store. Mutations will be applied in order, starting at number 1 (number 0 can be thought of as the creation of the store).

()

Source from the content-addressed store, hash-verified

85// starting at number 1 (number 0 can be thought of as the creation of the
86// store).
87func New() *Store {
88 ops := make(chan Op)
89 seqns := make(chan int64)
90 watches := make(chan int)
91
92 st := &Store{
93 Ops: ops,
94 Seqns: seqns,
95 Waiting: watches,
96 watchCh: make(chan *watch),
97 todo: new(vector.Vector),
98 watches: []*watch{},
99 state: &state{0, emptyDir},
100 log: map[int64]Event{},
101 cleanCh: make(chan int64),
102 flush: make(chan bool),
103 }
104
105 go st.process(ops, seqns, watches)
106 return st
107}
108
109func split(path string) []string {
110 if path == "/" {

Callers 15

TestGetMissingFunction · 0.85
TestGetFunction · 0.85
TestGetDeletedFunction · 0.85
TestSnapFunction · 0.85
TestApplyInOrderFunction · 0.85
TestGetSyncOneFunction · 0.85
TestGetSyncSeveralFunction · 0.85
TestGetSyncExtraFunction · 0.85
TestApplyBadThenGoodFunction · 0.85
TestApplyOutOfOrderFunction · 0.85
TestApplyIgnoreDuplicateFunction · 0.85

Calls 1

processMethod · 0.95

Tested by 15

TestGetMissingFunction · 0.68
TestGetFunction · 0.68
TestGetDeletedFunction · 0.68
TestSnapFunction · 0.68
TestApplyInOrderFunction · 0.68
TestGetSyncOneFunction · 0.68
TestGetSyncSeveralFunction · 0.68
TestGetSyncExtraFunction · 0.68
TestApplyBadThenGoodFunction · 0.68
TestApplyOutOfOrderFunction · 0.68
TestApplyIgnoreDuplicateFunction · 0.68