mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
freedom connection
This commit is contained in:
1 parent
f1292f6035
commit
19308037e5
3 files changed
+140
-1
No files matched your search
@@ -0,0 +1,37 @@
|
||||
// Package json contains io library for VConfig in Json format.
|
||||
package json
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
_ "fmt"
|
||||
|
||||
"github.com/v2ray/v2ray-core"
|
||||
)
|
||||
|
||||
type JsonVUser struct {
|
||||
id string `json:"id"`
|
||||
email string `json:"email"`
|
||||
}
|
||||
|
||||
type JsonVConfig struct {
|
||||
Port uint8 `json:"port"`
|
||||
Clients []JsonVUser `json:"users"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
type JsonVConfigUnmarshaller struct {
|
||||
}
|
||||
|
||||
func StringToVUser(id string) (u core.VUser, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (*JsonVConfigUnmarshaller) Unmarshall(data []byte) (*core.VConfig, error) {
|
||||
var jsonConfig JsonVConfig
|
||||
err := json.Unmarshal(data, &jsonConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var vconfig = new(core.VConfig)
|
||||
return vconfig, nil
|
||||
}
|
||||
Reference in new issue
Block a user