From 39bf59d37217bd31f6708947717568183dc24882 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 18 Jan 2022 16:15:49 +0200 Subject: [PATCH] add examples to docgen --- api/docgen/docgen.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index 571599935..1190b0dc4 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -300,6 +300,34 @@ func init() { Error: "", }) addExample(storiface.ResourceTable) + addExample(network.ScopeStat{ + Memory: 123, + NumStreamsInbound: 1, + NumStreamsOutbound: 2, + NumConnsInbound: 3, + NumConnsOutbound: 4, + NumFD: 5, + }) + addExample(map[string]network.ScopeStat{ + "abc": { + Memory: 123, + NumStreamsInbound: 1, + NumStreamsOutbound: 2, + NumConnsInbound: 3, + NumConnsOutbound: 4, + NumFD: 5, + }}) + addExample(api.NetLimit{ + Memory: 123, + StreamsInbound: 1, + StreamsOutbound: 2, + Streams: 3, + ConnsInbound: 3, + ConnsOutbound: 4, + Conns: 4, + FD: 5, + }) + } func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {