docsgen, lint

This commit is contained in:
Łukasz Magiera 2020-12-10 19:36:02 +01:00
parent d347e7ab8f
commit 564b88af52
3 changed files with 36 additions and 1 deletions

View File

@ -237,6 +237,9 @@ func init() {
addExample(map[abi.SectorNumber]string{ addExample(map[abi.SectorNumber]string{
123: "can't acquire read lock", 123: "can't acquire read lock",
}) })
addExample(map[api.SectorState]int{
api.SectorState(sealing.Proving): 120,
})
// worker specific // worker specific
addExample(storiface.AcquireMove) addExample(storiface.AcquireMove)

View File

@ -97,8 +97,10 @@
* [SectorStartSealing](#SectorStartSealing) * [SectorStartSealing](#SectorStartSealing)
* [Sectors](#Sectors) * [Sectors](#Sectors)
* [SectorsList](#SectorsList) * [SectorsList](#SectorsList)
* [SectorsListInStates](#SectorsListInStates)
* [SectorsRefs](#SectorsRefs) * [SectorsRefs](#SectorsRefs)
* [SectorsStatus](#SectorsStatus) * [SectorsStatus](#SectorsStatus)
* [SectorsSummary](#SectorsSummary)
* [SectorsUpdate](#SectorsUpdate) * [SectorsUpdate](#SectorsUpdate)
* [Storage](#Storage) * [Storage](#Storage)
* [StorageAddLocal](#StorageAddLocal) * [StorageAddLocal](#StorageAddLocal)
@ -1496,6 +1498,21 @@ Inputs: `null`
Response: `null` Response: `null`
### SectorsListInStates
List sectors in particular states
Perms: read
Inputs:
```json
[
null
]
```
Response: `null`
### SectorsRefs ### SectorsRefs
There are not yet any comments for this method. There are not yet any comments for this method.
@ -1564,6 +1581,21 @@ Response:
} }
``` ```
### SectorsSummary
Get summary info of sectors
Perms: read
Inputs: `null`
Response:
```json
{
"Proving": 120
}
```
### SectorsUpdate ### SectorsUpdate
There are not yet any comments for this method. There are not yet any comments for this method.

View File

@ -255,7 +255,7 @@ func (sm *StorageMinerAPI) SectorsSummary(ctx context.Context) (map[api.SectorSt
out := make(map[api.SectorState]int) out := make(map[api.SectorState]int)
for i := range sectors { for i := range sectors {
state := api.SectorState(sectors[i].State) state := api.SectorState(sectors[i].State)
out[state] += 1 out[state]++
} }
return out, nil return out, nil