完成dht的分布式储存

This commit is contained in:
2025-10-15 19:41:11 +08:00
parent 865d6fac65
commit 7184defc50
10 changed files with 226 additions and 53 deletions

View File

@@ -0,0 +1,14 @@
package p2p
import (
"context"
"github.com/ayflying/p2p/api/p2p/v1"
"github.com/gogf/gf/v2/frame/g"
)
func (c *ControllerV1) Ip(ctx context.Context, req *v1.IpReq) (res *v1.IpRes, err error) {
ip := g.RequestFromCtx(ctx).GetRemoteIp()
g.RequestFromCtx(ctx).Response.Write(ip)
return
}