mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
完成dht的分布式储存
This commit is contained in:
14
internal/controller/p2p/p2p_v1_ip.go
Normal file
14
internal/controller/p2p/p2p_v1_ip.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user