Documentation ¶
Index ¶
- Variables
- type Config
- type Dchan
- type HttpApi
- type HttpDelegate
- type Server
- func (s *Server) AllocIP() *ip.IP
- func (s *Server) Close()
- func (s *Server) GetAllDataChannel() []int
- func (s *Server) GetChannelType() string
- func (s *Server) GetDataChannel() int
- func (s *Server) GetGateway() *ip.IPNet
- func (s *Server) GetMTU() int
- func (s *Server) GetUserChannelFromDataChannel(id int) (fromUser packet.RecvChan, toUser packet.SendChan, err error)
- func (s *Server) GetUserToken(id int) ([]byte, error)
- func (s *Server) OnDChanUpdate(port []int)
- func (s *Server) OnNewChannel(ch dchan.Channel)
- func (s *Server) OnNewUser(userId int)
- func (s *Server) Run()
- type Shell
- type ShellCLI
- type ShellDebug
- type ShellDebugGoroutine
- type ShellDebugLog
- type ShellUser
- type ShellUserAdd
- type ShellUserShow
- type Tun
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWrongUserPassword = logex.Define("wrong username or password") ErrNotReady = logex.Define("not ready") )
View Source
var Slogan = `
_ _______ ________
/ |/ / __/ |/_/_ __/
/ / _/_> < / /
/_/|_/___/_/|_| /_/
`
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Debug bool `desc:"turn on debug"` DebugStack bool `default:"true"` DebugFlow bool DebugTun bool ChannelType string `name:"chantype" default:"tcp"` HTTP string `desc:"listen http port" default:":11311"` HTTPAes string `name:"key" desc:"http aes key; required"` HTTPCert string `desc:"https cert file path"` HTTPKey string `desc:"https key file path"` Sock string `desc:"unixsock for interactive with" default:"/tmp/next.sock"` MTU int `default:"1500"` Net *ip.IPNet `default:"10.8.0.1/24"` Pprof string `default:":10060"` DevId int DBPath string `desc:"filepath to persist user info" default:"nextuser"` }
func (*Config) FlaglyDesc ¶
func (*Config) FlaglyVerify ¶
type HttpDelegate ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetAllDataChannel ¶
func (*Server) GetChannelType ¶
func (*Server) GetDataChannel ¶
func (*Server) GetGateway ¶
func (*Server) GetUserChannelFromDataChannel ¶
func (s *Server) GetUserChannelFromDataChannel(id int) ( fromUser packet.RecvChan, toUser packet.SendChan, err error)
controller -> user -> datachannel
func (*Server) OnDChanUpdate ¶
func (*Server) OnNewChannel ¶
type ShellCLI ¶
type ShellCLI struct { Help flagly.CmdHelp `flagly:"handler"` User ShellUser `flagly:"handler"` Debug *ShellDebug `flagly:"handler"` Dchan *Dchan `flagly:"handler"` }
type ShellDebug ¶
type ShellDebug struct { Goroutine *ShellDebugGoroutine `flagly:"handler"` Log *ShellDebugLog `flagly:"handler"` }
type ShellDebugGoroutine ¶
type ShellDebugGoroutine struct {
Find string `type:"[0]"`
}
func (ShellDebugGoroutine) FlaglyHandle ¶
func (s ShellDebugGoroutine) FlaglyHandle(rl *readline.Instance) error
type ShellDebugLog ¶
type ShellDebugLog struct {
Level string `type:"[0]" select:"debug,info,warn,error"`
}
func (ShellDebugLog) FlaglyHandle ¶
func (s ShellDebugLog) FlaglyHandle(rl *readline.Instance) error
type ShellUser ¶
type ShellUser struct { Show *ShellUserShow `flagly:"handler"` Add *ShellUserAdd `flagly:"handler"` }
type ShellUserAdd ¶
type ShellUserAdd struct {
Name string `type:"[0]"`
}
func (*ShellUserAdd) FlaglyHandle ¶
func (c *ShellUserAdd) FlaglyHandle(s *Server, rl *readline.Instance) error
type ShellUserShow ¶
type ShellUserShow struct {
All bool `name:"a"`
}
func (ShellUserShow) FlaglyHandle ¶
func (su ShellUserShow) FlaglyHandle(s *Server, rl *readline.Instance) error
Click to show internal directories.
Click to hide internal directories.