mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
首次提交
This commit is contained in:
16
api/p2p/p2p.go
Normal file
16
api/p2p/p2p.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ayflying/p2p/api/p2p/v1"
|
||||
)
|
||||
|
||||
type IP2PV1 interface {
|
||||
Connect(ctx context.Context, req *v1.ConnectReq) (res *v1.ConnectRes, err error)
|
||||
Send(ctx context.Context, req *v1.SendReq) (res *v1.SendRes, err error)
|
||||
}
|
||||
20
api/p2p/v1/p2p.go
Normal file
20
api/p2p/v1/p2p.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type ConnectReq struct {
|
||||
g.Meta `path:"/p2p/connect" tags:"p2p" method:"get" sm:"连接到目标主机"`
|
||||
TargetID string `json:"id"`
|
||||
}
|
||||
type ConnectRes struct {
|
||||
g.Meta `mime:"text/html" example:"string"`
|
||||
}
|
||||
|
||||
type SendReq struct {
|
||||
g.Meta `path:"/p2p/send" tags:"p2p" method:"get" sm:"发送消息"`
|
||||
TargetID string `json:"id"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
type SendRes struct {
|
||||
g.Meta `mime:"text/html" example:"string"`
|
||||
}
|
||||
Reference in New Issue
Block a user