ceremonyclient/go-libp2p/p2p/host/autorelay/host.go
2023-08-20 23:07:43 -05:00

24 lines
373 B
Go

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}
}