slightly better methodgroup parsing, and more group docs
This commit is contained in:
parent
cb88237305
commit
c54d050cb7
@ -104,9 +104,15 @@ type FullNode interface {
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
|
// MethodGroup: Client
|
||||||
|
// The Client methods all have to do with interacting with the storage and
|
||||||
|
// retrieval markets as a client
|
||||||
|
|
||||||
// ClientImport imports file under the specified path into filestore
|
// ClientImport imports file under the specified path into filestore
|
||||||
ClientImport(ctx context.Context, ref FileRef) (cid.Cid, error)
|
ClientImport(ctx context.Context, ref FileRef) (cid.Cid, error)
|
||||||
|
// ClientStartDeal proposes a deal with a miner
|
||||||
ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error)
|
ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error)
|
||||||
|
// ClientGetDeal info returns the latest information about a given deal
|
||||||
ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error)
|
ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error)
|
||||||
ClientListDeals(ctx context.Context) ([]DealInfo, error)
|
ClientListDeals(ctx context.Context) ([]DealInfo, error)
|
||||||
ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error)
|
ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error)
|
||||||
@ -124,6 +130,9 @@ type FullNode interface {
|
|||||||
|
|
||||||
//ClientListAsks() []Ask
|
//ClientListAsks() []Ask
|
||||||
|
|
||||||
|
// MethodGroup: State
|
||||||
|
// The State methods are used to query, inspect, and interact with chain state
|
||||||
|
|
||||||
// if tipset is nil, we'll use heaviest
|
// if tipset is nil, we'll use heaviest
|
||||||
StateCall(context.Context, *types.Message, types.TipSetKey) (*InvocResult, error)
|
StateCall(context.Context, *types.Message, types.TipSetKey) (*InvocResult, error)
|
||||||
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error)
|
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error)
|
||||||
@ -158,6 +167,10 @@ type FullNode interface {
|
|||||||
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error)
|
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error)
|
||||||
StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*ComputeStateOutput, error)
|
StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*ComputeStateOutput, error)
|
||||||
|
|
||||||
|
// MethodGroup: Msig
|
||||||
|
// The Msig methods are used to interact with multisig wallets on the
|
||||||
|
// filecoin network
|
||||||
|
|
||||||
MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
|
MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
|
||||||
MsigCreate(context.Context, int64, []address.Address, types.BigInt, address.Address, types.BigInt) (cid.Cid, error)
|
MsigCreate(context.Context, int64, []address.Address, types.BigInt, address.Address, types.BigInt) (cid.Cid, error)
|
||||||
MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error)
|
MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error)
|
||||||
@ -167,6 +180,9 @@ type FullNode interface {
|
|||||||
MarketEnsureAvailable(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error)
|
MarketEnsureAvailable(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error)
|
||||||
// MarketFreeBalance
|
// MarketFreeBalance
|
||||||
|
|
||||||
|
// MethodGroup: Paych
|
||||||
|
// The Paych methods are for interacting with and managing payment channels
|
||||||
|
|
||||||
PaychGet(ctx context.Context, from, to address.Address, ensureFunds types.BigInt) (*ChannelInfo, error)
|
PaychGet(ctx context.Context, from, to address.Address, ensureFunds types.BigInt) (*ChannelInfo, error)
|
||||||
PaychList(context.Context) ([]address.Address, error)
|
PaychList(context.Context) ([]address.Address, error)
|
||||||
PaychStatus(context.Context, address.Address) (*PaychStatus, error)
|
PaychStatus(context.Context, address.Address) (*PaychStatus, error)
|
||||||
|
@ -190,6 +190,8 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
|
|||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const noComment = "There are not yet any comments for this method."
|
||||||
|
|
||||||
func parseApiASTInfo() (map[string]string, map[string]string) {
|
func parseApiASTInfo() (map[string]string, map[string]string) {
|
||||||
|
|
||||||
fset := token.NewFileSet()
|
fset := token.NewFileSet()
|
||||||
@ -212,7 +214,7 @@ func parseApiASTInfo() (map[string]string, map[string]string) {
|
|||||||
for mn, node := range v.Methods {
|
for mn, node := range v.Methods {
|
||||||
cs := cmap.Filter(node).Comments()
|
cs := cmap.Filter(node).Comments()
|
||||||
if len(cs) == 0 {
|
if len(cs) == 0 {
|
||||||
out[mn] = "There are not yet any comments for this method."
|
out[mn] = noComment
|
||||||
} else {
|
} else {
|
||||||
for _, c := range cs {
|
for _, c := range cs {
|
||||||
if strings.HasPrefix(c.Text(), "MethodGroup:") {
|
if strings.HasPrefix(c.Text(), "MethodGroup:") {
|
||||||
@ -220,10 +222,17 @@ func parseApiASTInfo() (map[string]string, map[string]string) {
|
|||||||
groupName := strings.TrimSpace(parts[0][12:])
|
groupName := strings.TrimSpace(parts[0][12:])
|
||||||
comment := strings.Join(parts[1:], "\n")
|
comment := strings.Join(parts[1:], "\n")
|
||||||
groupDocs[groupName] = comment
|
groupDocs[groupName] = comment
|
||||||
|
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out[mn] = cs[len(cs)-1].Text()
|
last := cs[len(cs)-1].Text()
|
||||||
|
if !strings.HasPrefix(last, "MethodGroup:") {
|
||||||
|
out[mn] = last
|
||||||
|
} else {
|
||||||
|
out[mn] = noComment
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out, groupDocs
|
return out, groupDocs
|
||||||
|
Loading…
Reference in New Issue
Block a user