From 382734b057888fb02d7fd3039eb90b53d631a722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 18 Jun 2020 14:56:00 +0200 Subject: [PATCH] docgen: Generate simple index --- api/api_common.go | 8 ++++++-- api/docgen/docgen.go | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/api/api_common.go b/api/api_common.go index 6d47e35f7..aa63e9815 100644 --- a/api/api_common.go +++ b/api/api_common.go @@ -13,11 +13,13 @@ import ( ) type Common interface { - // Auth + + // MethodGroup: Auth + AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error) - // network + // MethodGroup: Net NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) NetPeers(context.Context) ([]peer.AddrInfo, error) @@ -27,6 +29,8 @@ type Common interface { NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error) NetPubsubScores(context.Context) ([]PubsubScore, error) + // MethodGroup: Common + // ID returns peerID of libp2p node backing this API ID(context.Context) (peer.ID, error) diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index 39892c820..f876e280e 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -325,6 +325,15 @@ func main() { return groupslice[i].GroupName < groupslice[j].GroupName }) + fmt.Printf("# Groups\n") + + for _, g := range groupslice { + fmt.Printf("* [%s](#%s)\n", g.GroupName, g.GroupName) + for _, method := range g.Methods { + fmt.Printf(" * [%s](#%s)\n", method.Name, method.Name) + } + } + for _, g := range groupslice { g := g fmt.Printf("## %s\n", g.GroupName)