mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-02 00:44:59 +00:00
Merge 2ee3c8311a
into b6e3dc5f02
This commit is contained in:
commit
1b27ef53df
13 changed files with 517 additions and 288 deletions
15
pkg/utils/p2p.go
Normal file
15
pkg/utils/p2p.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package utils
|
||||
|
||||
import "github.com/multiformats/go-multiaddr"
|
||||
|
||||
func StringsToMultiAddr(peers []string) []multiaddr.Multiaddr {
|
||||
res := []multiaddr.Multiaddr{}
|
||||
for _, p := range peers {
|
||||
addr, err := multiaddr.NewMultiaddr(p)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
res = append(res, addr)
|
||||
}
|
||||
return res
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue