Documentation ¶
Index ¶
- func DelValue(key string) error
- func GetValue(key string) (string, error)
- func Save(config *ServerConfig, path string) bool
- func SetValue(key string, value string) error
- func WriteClient(port int, password, domain, writePath string) bool
- func WriteDomain(domain string) bool
- func WriteLogLevel(level int) bool
- func WriteMysql(mysql *Mysql) bool
- func WritePassword(pass []string) bool
- func WriteTls(cert, key, domain string) bool
- type ClientConfig
- type ClientSSL
- type ClientTCP
- type Config
- type Mysql
- func (mysql *Mysql) CleanData(id uint) error
- func (mysql *Mysql) CreateTable()
- func (mysql *Mysql) CreateUser(username string, base64Pass string, originPass string) error
- func (mysql *Mysql) DeleteUser(id uint) error
- func (mysql *Mysql) GetDB() *sql.DB
- func (mysql *Mysql) GetData(ids ...string) ([]*User, error)
- func (mysql *Mysql) GetUserByName(name string) *User
- func (mysql *Mysql) GetUserByPass(pass string) *User
- func (mysql *Mysql) PageList(curPage int, pageSize int) (*PageQuery, error)
- func (mysql *Mysql) SetQuota(id uint, quota int) error
- func (mysql *Mysql) UpdateUser(id uint, username string, base64Pass string, originPass string) error
- func (mysql *Mysql) UpgradeDB() error
- type PageQuery
- type SSL
- type ServerConfig
- type ServerSSL
- type ServerTCP
- type TCP
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteClient ¶
WriteClient 生成客户端json
Types ¶
type ClientConfig ¶
ClientConfig 结构体
type ClientSSL ¶
type ClientSSL struct { SSL Verify bool `json:"verify"` VerifyHostname bool `json:"verify_hostname"` }
ClientSSL 结构体
type Config ¶
type Config struct { RunType string `json:"run_type"` LocalAddr string `json:"local_addr"` LocalPort int `json:"local_port"` RemoteAddr string `json:"remote_addr"` RemotePort int `json:"remote_port"` Password []string `json:"password"` LogLevel int `json:"log_level"` }
Config 结构体
type Mysql ¶
type Mysql struct { Enabled bool `json:"enabled"` ServerAddr string `json:"server_addr"` ServerPort int `json:"server_port"` Database string `json:"database"` Username string `json:"username"` Password string `json:"password"` Cafile string `json:"cafile"` }
Mysql 结构体
func (*Mysql) CreateUser ¶
CreateUser 创建Trojan用户
func (*Mysql) GetUserByName ¶
GetUserByName 通过用户名来获取用户
func (*Mysql) GetUserByPass ¶
GetUserByPass 通过密码来获取用户
type SSL ¶
type SSL struct { Cert string `json:"cert"` Cipher string `json:"cipher"` CipherTls13 string `json:"cipher_tls13"` Alpn []string `json:"alpn"` ReuseSession bool `json:"reuse_session"` SessionTicket bool `json:"session_ticket"` Curves string `json:"curves"` Sni string `json:"sni"` }
SSL 结构体
type ServerConfig ¶
type ServerConfig struct { Config SSl ServerSSL `json:"ssl"` Tcp ServerTCP `json:"tcp"` Mysql Mysql `json:"mysql"` }
ServerConfig 结构体
type ServerSSL ¶
type ServerSSL struct { SSL Key string `json:"key"` KeyPassword string `json:"key_password"` PreferServerCipher bool `json:"prefer_server_cipher"` SessionTimeout int `json:"session_timeout"` PlainHttpResponse string `json:"plain_http_response"` Dhparam string `json:"dhparam"` }
ServerSSL 结构体
Click to show internal directories.
Click to hide internal directories.