mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
增加代理接口
This commit is contained in:
18
internal/message/consts.go
Normal file
18
internal/message/consts.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package message
|
||||
|
||||
import (
|
||||
v1 "github.com/ayflying/p2p/api/p2p/v1"
|
||||
"github.com/ayflying/p2p/internal/message/http"
|
||||
"github.com/ayflying/p2p/internal/message/proxy"
|
||||
"github.com/ayflying/p2p/internal/message/proxyAck"
|
||||
)
|
||||
|
||||
type P2PMessage interface {
|
||||
Message(msg *v1.Message) (err error)
|
||||
}
|
||||
|
||||
var Run = map[string]P2PMessage{
|
||||
"proxy": proxy.New,
|
||||
"proxy_ack": proxyAck.New,
|
||||
"http": http.New,
|
||||
}
|
||||
Reference in New Issue
Block a user