()
| 128 | } |
| 129 | |
| 130 | func (s *Store) SlotMappings() ([]*SlotMapping, error) { |
| 131 | slots := make([]*SlotMapping, MaxSlotNum) |
| 132 | for i := range slots { |
| 133 | m, err := s.LoadSlotMapping(i, false) |
| 134 | if err != nil { |
| 135 | return nil, err |
| 136 | } |
| 137 | if m != nil { |
| 138 | slots[i] = m |
| 139 | } else { |
| 140 | slots[i] = &SlotMapping{Id: i} |
| 141 | } |
| 142 | } |
| 143 | return slots, nil |
| 144 | } |
| 145 | |
| 146 | func (s *Store) LoadSlotMapping(sid int, must bool) (*SlotMapping, error) { |
| 147 | b, err := s.client.Read(s.SlotPath(sid), must) |
no test coverage detected