client, pkg, server, test: replaced 'interface{}' with 'any' (#4611)

This commit is contained in:
Gabriel Marin
2025-01-02 05:24:08 +02:00
committed by GitHub
parent 01fed8d1a9
commit 092e5d3f94
19 changed files with 77 additions and 77 deletions

View File

@@ -72,7 +72,7 @@ func (p *httpPlugin) IsSupport(op string) bool {
return false
}
func (p *httpPlugin) Handle(ctx context.Context, op string, content interface{}) (*Response, interface{}, error) {
func (p *httpPlugin) Handle(ctx context.Context, op string, content any) (*Response, any, error) {
r := &Request{
Version: APIVersion,
Op: op,

View File

@@ -75,7 +75,7 @@ func (m *Manager) Login(content *LoginContent) (*LoginContent, error) {
Reject: false,
Unchange: true,
}
retContent interface{}
retContent any
err error
)
reqid, _ := util.RandID()
@@ -109,7 +109,7 @@ func (m *Manager) NewProxy(content *NewProxyContent) (*NewProxyContent, error) {
Reject: false,
Unchange: true,
}
retContent interface{}
retContent any
err error
)
reqid, _ := util.RandID()
@@ -168,7 +168,7 @@ func (m *Manager) Ping(content *PingContent) (*PingContent, error) {
Reject: false,
Unchange: true,
}
retContent interface{}
retContent any
err error
)
reqid, _ := util.RandID()
@@ -202,7 +202,7 @@ func (m *Manager) NewWorkConn(content *NewWorkConnContent) (*NewWorkConnContent,
Reject: false,
Unchange: true,
}
retContent interface{}
retContent any
err error
)
reqid, _ := util.RandID()
@@ -236,7 +236,7 @@ func (m *Manager) NewUserConn(content *NewUserConnContent) (*NewUserConnContent,
Reject: false,
Unchange: true,
}
retContent interface{}
retContent any
err error
)
reqid, _ := util.RandID()

View File

@@ -32,5 +32,5 @@ const (
type Plugin interface {
Name() string
IsSupport(op string) bool
Handle(ctx context.Context, op string, content interface{}) (res *Response, retContent interface{}, err error)
Handle(ctx context.Context, op string, content any) (res *Response, retContent any, err error)
}

View File

@@ -19,16 +19,16 @@ import (
)
type Request struct {
Version string `json:"version"`
Op string `json:"op"`
Content interface{} `json:"content"`
Version string `json:"version"`
Op string `json:"op"`
Content any `json:"content"`
}
type Response struct {
Reject bool `json:"reject"`
RejectReason string `json:"reject_reason"`
Unchange bool `json:"unchange"`
Content interface{} `json:"content"`
Reject bool `json:"reject"`
RejectReason string `json:"reject_reason"`
Unchange bool `json:"unchange"`
Content any `json:"content"`
}
type LoginContent struct {