Plumb connection limit to proxy and output it (#384)
This commit is contained in:
1 parent
7db0e2a5ed
commit
f7e48ec836
9 files changed
+149
-59
No files matched your search
@@ -1,10 +1,12 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
)
|
||||
|
||||
func generateConnectionInfoTableOutput(in ConnectionInfo) string {
|
||||
func generateSessionInfoTableOutput(in SessionInfo) string {
|
||||
var ret []string
|
||||
|
||||
nonAttributeMap := map[string]interface{}{
|
||||
@@ -29,3 +31,28 @@ func generateConnectionInfoTableOutput(in ConnectionInfo) string {
|
||||
|
||||
return base.WrapForHelpText(ret)
|
||||
}
|
||||
|
||||
func generateConnectionInfoTableOutput(in ConnectionInfo) string {
|
||||
var ret []string
|
||||
|
||||
nonAttributeMap := map[string]interface{}{
|
||||
"Connections Left": in.ConnectionsLeft,
|
||||
"Expiration": in.Expiration.Local().Format(time.RFC1123),
|
||||
}
|
||||
|
||||
maxLength := 0
|
||||
for k := range nonAttributeMap {
|
||||
if len(k) > maxLength {
|
||||
maxLength = len(k)
|
||||
}
|
||||
}
|
||||
|
||||
ret = append(ret, "", "Connection information:")
|
||||
|
||||
ret = append(ret,
|
||||
// We do +2 because there is another +2 offset for host sets below
|
||||
base.WrapMap(2, maxLength+2, nonAttributeMap),
|
||||
)
|
||||
|
||||
return base.WrapForHelpText(ret)
|
||||
}
|
||||
Reference in new issue
Block a user