This commit is contained in:
zyj
2025-08-26 18:53:34 +08:00
commit 96db69b7e4
9 changed files with 329 additions and 0 deletions

24
libs/client.go Normal file
View File

@@ -0,0 +1,24 @@
package libs
import (
"sync"
"github.com/libp2p/go-libp2p/core/host"
)
type Client struct {
This host.Host
}
var once sync.Once
var clientObj *Client
func InitClient() *Client {
once.Do(func() {
clientObj = &Client{}
})
return clientObj
}