make gen and friends

This commit is contained in:
vyzo 2022-01-20 11:44:01 +02:00
parent ca4ee1e8cf
commit b360c9403f
11 changed files with 586 additions and 0 deletions

View File

@ -1811,6 +1811,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
}
// NetLimit mocks base method.
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
ret0, _ := ret[0].(api.NetLimit)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetLimit indicates an expected call of NetLimit.
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
}
// NetPeerInfo mocks base method.
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
m.ctrl.T.Helper()
@ -1856,6 +1871,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
}
// NetSetLimit mocks base method.
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// NetSetLimit indicates an expected call of NetSetLimit.
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
}
// NetStat mocks base method.
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
ret0, _ := ret[0].(api.NetStat)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetStat indicates an expected call of NetStat.
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
}
// NodeStatus mocks base method.
func (m *MockFullNode) NodeStatus(arg0 context.Context, arg1 bool) (api.NodeStatus, error) {
m.ctrl.T.Helper()

View File

@ -587,11 +587,17 @@ type NetStruct struct {
NetFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"`
NetLimit func(p0 context.Context, p1 string) (NetLimit, error) `perm:"read"`
NetPeerInfo func(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) `perm:"read"`
NetPeers func(p0 context.Context) ([]peer.AddrInfo, error) `perm:"read"`
NetPubsubScores func(p0 context.Context) ([]PubsubScore, error) `perm:"read"`
NetSetLimit func(p0 context.Context, p1 string, p2 NetLimit) error `perm:"admin"`
NetStat func(p0 context.Context, p1 string) (NetStat, error) `perm:"read"`
}
}
@ -3625,6 +3631,17 @@ func (s *NetStub) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, er
return *new(peer.AddrInfo), ErrNotSupported
}
func (s *NetStruct) NetLimit(p0 context.Context, p1 string) (NetLimit, error) {
if s.Internal.NetLimit == nil {
return *new(NetLimit), ErrNotSupported
}
return s.Internal.NetLimit(p0, p1)
}
func (s *NetStub) NetLimit(p0 context.Context, p1 string) (NetLimit, error) {
return *new(NetLimit), ErrNotSupported
}
func (s *NetStruct) NetPeerInfo(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) {
if s.Internal.NetPeerInfo == nil {
return nil, ErrNotSupported
@ -3658,6 +3675,28 @@ func (s *NetStub) NetPubsubScores(p0 context.Context) ([]PubsubScore, error) {
return *new([]PubsubScore), ErrNotSupported
}
func (s *NetStruct) NetSetLimit(p0 context.Context, p1 string, p2 NetLimit) error {
if s.Internal.NetSetLimit == nil {
return ErrNotSupported
}
return s.Internal.NetSetLimit(p0, p1, p2)
}
func (s *NetStub) NetSetLimit(p0 context.Context, p1 string, p2 NetLimit) error {
return ErrNotSupported
}
func (s *NetStruct) NetStat(p0 context.Context, p1 string) (NetStat, error) {
if s.Internal.NetStat == nil {
return *new(NetStat), ErrNotSupported
}
return s.Internal.NetStat(p0, p1)
}
func (s *NetStub) NetStat(p0 context.Context, p1 string) (NetStat, error) {
return *new(NetStat), ErrNotSupported
}
func (s *SignableStruct) Sign(p0 context.Context, p1 SignFunc) error {
if s.Internal.Sign == nil {
return ErrNotSupported

View File

@ -1724,6 +1724,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
}
// NetLimit mocks base method.
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
ret0, _ := ret[0].(api.NetLimit)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetLimit indicates an expected call of NetLimit.
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
}
// NetPeerInfo mocks base method.
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
m.ctrl.T.Helper()
@ -1769,6 +1784,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
}
// NetSetLimit mocks base method.
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// NetSetLimit indicates an expected call of NetSetLimit.
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
}
// NetStat mocks base method.
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
ret0, _ := ret[0].(api.NetStat)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetStat indicates an expected call of NetStat.
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
}
// PaychAllocateLane mocks base method.
func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
m.ctrl.T.Helper()

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -81,9 +81,12 @@
* [NetConnectedness](#NetConnectedness)
* [NetDisconnect](#NetDisconnect)
* [NetFindPeer](#NetFindPeer)
* [NetLimit](#NetLimit)
* [NetPeerInfo](#NetPeerInfo)
* [NetPeers](#NetPeers)
* [NetPubsubScores](#NetPubsubScores)
* [NetSetLimit](#NetSetLimit)
* [NetStat](#NetStat)
* [Pieces](#Pieces)
* [PiecesGetCIDInfo](#PiecesGetCIDInfo)
* [PiecesGetPieceInfo](#PiecesGetPieceInfo)
@ -1698,6 +1701,32 @@ Response:
}
```
### NetLimit
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
```
### NetPeerInfo
@ -1783,6 +1812,94 @@ Response:
]
```
### NetSetLimit
Perms: admin
Inputs:
```json
[
"string value",
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
]
```
Response: `{}`
### NetStat
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"System": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Transient": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Services": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Protocols": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Peers": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
}
}
```
## Pieces

View File

@ -128,9 +128,12 @@
* [NetConnectedness](#NetConnectedness)
* [NetDisconnect](#NetDisconnect)
* [NetFindPeer](#NetFindPeer)
* [NetLimit](#NetLimit)
* [NetPeerInfo](#NetPeerInfo)
* [NetPeers](#NetPeers)
* [NetPubsubScores](#NetPubsubScores)
* [NetSetLimit](#NetSetLimit)
* [NetStat](#NetStat)
* [Paych](#Paych)
* [PaychAllocateLane](#PaychAllocateLane)
* [PaychAvailableFunds](#PaychAvailableFunds)
@ -3821,6 +3824,32 @@ Response:
}
```
### NetLimit
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
```
### NetPeerInfo
@ -3906,6 +3935,94 @@ Response:
]
```
### NetSetLimit
Perms: admin
Inputs:
```json
[
"string value",
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
]
```
Response: `{}`
### NetStat
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"System": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Transient": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Services": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Protocols": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Peers": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
}
}
```
## Paych
The Paych methods are for interacting with and managing payment channels

View File

@ -134,9 +134,12 @@
* [NetConnectedness](#NetConnectedness)
* [NetDisconnect](#NetDisconnect)
* [NetFindPeer](#NetFindPeer)
* [NetLimit](#NetLimit)
* [NetPeerInfo](#NetPeerInfo)
* [NetPeers](#NetPeers)
* [NetPubsubScores](#NetPubsubScores)
* [NetSetLimit](#NetSetLimit)
* [NetStat](#NetStat)
* [Node](#Node)
* [NodeStatus](#NodeStatus)
* [Paych](#Paych)
@ -4182,6 +4185,32 @@ Response:
}
```
### NetLimit
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
```
### NetPeerInfo
@ -4267,6 +4296,94 @@ Response:
]
```
### NetSetLimit
Perms: admin
Inputs:
```json
[
"string value",
{
"Memory": 123,
"Streams": 3,
"StreamsInbound": 1,
"StreamsOutbound": 2,
"Conns": 4,
"ConnsInbound": 3,
"ConnsOutbound": 4,
"FD": 5
}
]
```
Response: `{}`
### NetStat
Perms: read
Inputs:
```json
[
"string value"
]
```
Response:
```json
{
"System": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Transient": {
"NumStreamsInbound": 123,
"NumStreamsOutbound": 123,
"NumConnsInbound": 123,
"NumConnsOutbound": 123,
"NumFD": 123,
"Memory": 9
},
"Services": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Protocols": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
},
"Peers": {
"abc": {
"NumStreamsInbound": 1,
"NumStreamsOutbound": 2,
"NumConnsInbound": 3,
"NumConnsOutbound": 4,
"NumFD": 5,
"Memory": 123
}
}
}
```
## Node
These methods are general node management and status commands

View File

@ -1160,6 +1160,8 @@ COMMANDS:
reachability Print information about reachability from the internet
bandwidth Print bandwidth usage information
block Manage network connection gating rules
stat Report resource usage for a scope
limit Get or set resource limits for a scope
help, h Shows a list of commands or help for one command
OPTIONS:
@ -1428,6 +1430,58 @@ OPTIONS:
```
### lotus-miner net stat
```
NAME:
lotus-miner net stat - Report resource usage for a scope
USAGE:
lotus-miner net stat [command options] scope
DESCRIPTION:
Report resource usage for a scope.
The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.
- all -- reports the resource usage for all currently active scopes.
OPTIONS:
--help, -h show help (default: false)
```
### lotus-miner net limit
```
NAME:
lotus-miner net limit - Get or set resource limits for a scope
USAGE:
lotus-miner net limit [command options] scope [limit]
DESCRIPTION:
Get or set resource limits for a scope.
The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.
The limit is json-formatted, with the same structure as the limits file.
OPTIONS:
--set set the limit for a scope (default: false)
--help, -h show help (default: false)
```
## lotus-miner pieces
```
NAME:

View File

@ -2616,6 +2616,8 @@ COMMANDS:
reachability Print information about reachability from the internet
bandwidth Print bandwidth usage information
block Manage network connection gating rules
stat Report resource usage for a scope
limit Get or set resource limits for a scope
help, h Shows a list of commands or help for one command
OPTIONS:
@ -2884,6 +2886,58 @@ OPTIONS:
```
### lotus net stat
```
NAME:
lotus net stat - Report resource usage for a scope
USAGE:
lotus net stat [command options] scope
DESCRIPTION:
Report resource usage for a scope.
The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.
- all -- reports the resource usage for all currently active scopes.
OPTIONS:
--help, -h show help (default: false)
```
### lotus net limit
```
NAME:
lotus net limit - Get or set resource limits for a scope
USAGE:
lotus net limit [command options] scope [limit]
DESCRIPTION:
Get or set resource limits for a scope.
The scope can be one of the following:
- system -- reports the system aggregate resource usage.
- transient -- reports the transient resource usage.
- svc:<service> -- reports the resource usage of a specific service.
- proto:<proto> -- reports the resource usage of a specific protocol.
- peer:<peer> -- reports the resource usage of a specific peer.
The limit is json-formatted, with the same structure as the limits file.
OPTIONS:
--set set the limit for a scope (default: false)
--help, -h show help (default: false)
```
## lotus sync
```
NAME: