1
2
3
4
5 package cmem
6
7 import (
8 "./aconfig"
9 "./bresource"
10 )
11
12 type MemT *int
13
14 var G int
15
16 type memResource struct {
17 x *int
18 }
19
20 func (m *memResource) initialize(*int) (res *int, err error) {
21 return nil, nil
22 }
23
24 func (m *memResource) teardown() {
25 }
26
27 func NewResource(cfg *aconfig.Config) *bresource.Resource[*int] {
28 res := &memResource{
29 x: &G,
30 }
31
32 return bresource.New("Mem", res.initialize, bresource.ResConfig{
33
34 ShouldRetry: func(error) bool { return true },
35 TearDown: res.teardown,
36 })
37 }
38
View as plain text