feat: add hgctl dashboard support (#552)

Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
Xunzhuo
2023-09-22 13:51:22 +08:00
committed by GitHub
parent 2da1c62c69
commit eb2934c084
7 changed files with 362 additions and 7 deletions

View File

@@ -48,6 +48,9 @@ type PortForwarder interface {
// Address returns the address of the local forwarded address.
Address() string
// WaitForStop blocks until connection closed (e.g. control-C interrupt)
WaitForStop()
}
var _ PortForwarder = &localForwarder{}
@@ -153,3 +156,7 @@ func (f *localForwarder) Stop() {
func (f *localForwarder) Address() string {
return fmt.Sprintf("%s:%d", DefaultLocalAddress, f.localPort)
}
func (f *localForwarder) WaitForStop() {
<-f.stopCh
}