forked from lovoo/goka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.go
More file actions
42 lines (34 loc) · 703 Bytes
/
proxy.go
File metadata and controls
42 lines (34 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package goka
import (
"github.com/lovoo/goka/storage"
)
type storageProxy struct {
storage.Storage
topic Stream
partition int32
stateless bool
update UpdateCallback
openedOnce once
closedOnce once
}
func (s *storageProxy) Open() error {
if s == nil {
return nil
}
return s.openedOnce.Do(s.Storage.Open)
}
func (s *storageProxy) Close() error {
if s == nil {
return nil
}
return s.closedOnce.Do(s.Storage.Close)
}
func (s *storageProxy) Update(ctx UpdateContext, k string, v []byte) error {
return s.update(ctx, s, k, v)
}
func (s *storageProxy) Stateless() bool {
return s.stateless
}
func (s *storageProxy) MarkRecovered() error {
return s.Storage.MarkRecovered()
}