ceremonyclient/go-libp2p/p2p/host/autorelay/host.go

24 lines
373 B
Go
Raw Permalink Normal View History

2023-08-21 03:50:38 +00:00
package autorelay
import (
"github.com/libp2p/go-libp2p/core/host"
)
type AutoRelayHost struct {
host.Host
ar *AutoRelay
}
func (h *AutoRelayHost) Close() error {
_ = h.ar.Close()
return h.Host.Close()
}
func (h *AutoRelayHost) Start() {
h.ar.Start()
}
func NewAutoRelayHost(h host.Host, ar *AutoRelay) *AutoRelayHost {
return &AutoRelayHost{Host: h, ar: ar}
}