Documentation ¶
Index ¶
- Variables
- func ConfigSetServer(maxBufferLen, rwBufferLen, port int, host, appid, appkey string, margic bool)
- func ConfigSetTls(needTls bool, tlsPort int, caCert string, caKey string)
- type AppConfigure
- type AppCredentialConfig
- type AppServerConfigure
- type AppTlsConfigure
- type AppWebConfigure
- type AppWebHttpConfigure
- type AppWebHttpsConfigure
- type AppWebStaticConfigure
- type BytezeroNet
- func (bzn *BytezeroNet) AccessIpsAllow(ip string) error
- func (bzn *BytezeroNet) AccessIpsDeny(ip string) error
- func (bzn *BytezeroNet) AccessIpsForbid(ip string, deny bool) error
- func (bzn *BytezeroNet) AccessIpsReload(allow bool) error
- func (bzn *BytezeroNet) AppID() string
- func (bzn *BytezeroNet) AppKey() string
- func (bzn *BytezeroNet) CredentialExpiredMs() int64
- func (bzn *BytezeroNet) CredentialUrls() []string
- func (bzn *BytezeroNet) HandleConn(conn net.Conn) error
- func (bzn *BytezeroNet) HandleConnClose(connection interface{})
- func (bzn *BytezeroNet) HandlePt(conn bz.BZNetReceiver, commonPt *protocol.CommonPt) error
- func (bzn *BytezeroNet) Main()
- func (bzn *BytezeroNet) MargicV() (byte, bool)
- func (bzn *BytezeroNet) Quit() bool
- func (bzn *BytezeroNet) StartTcp()
- func (bzn *BytezeroNet) StartTls()
- func (bzn *BytezeroNet) StartUdp()
- func (bzn *BytezeroNet) StartWeb()
- func (bzn *BytezeroNet) Stats() (interface{}, error)
- func (bzn *BytezeroNet) SystemReload() error
- func (bzn *BytezeroNet) SystemRestart() error
- func (bzn *BytezeroNet) SystemStop() error
- func (bzn *BytezeroNet) Wait()
- type Channel
- type Configure
- type Connection
- func (c *Connection) ChannId() string
- func (c *Connection) Check() error
- func (c *Connection) Equals(o *Connection) bool
- func (c *Connection) Id() string
- func (c *Connection) Main() *Connection
- func (c *Connection) Quit()
- func (c *Connection) Send(buf []byte) error
- func (c *Connection) Set(info *protocol.ChannelCreatePt) *Connection
- func (c Connection) String() string
- func (c *Connection) Transit(buf []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var APPVersion = "v1.0.0"
APPVersion APP本地控制
View Source
var SWG = sync.WaitGroup{}
SWG -
Functions ¶
func ConfigSetServer ¶
ConfigSetServer -
Types ¶
type AppConfigure ¶
type AppConfigure struct { Name string `yaml:"name" json:"name" binding:"required"` Version string `yaml:"version" json:"version" binding:"required"` Server AppServerConfigure `yaml:"server" json:"server" binding:"required"` Tls AppTlsConfigure `yaml:"tls" json:"tls" binding:"required"` Web AppWebConfigure `yaml:"web" json:"web" binding:"required"` MaxBufferLen int `yaml:"maxBufferLen" json:"maxBufferLen" binding:"required"` RWBufferLen int `yaml:"rwBufferLen" json:"rwBufferLen" binding:"required"` Appid string `yaml:"appid" json:"appid" binding:"required"` Appkey string `yaml:"appkey" json:"appkey" binding:"required"` LogPath string `yaml:"logPath" json:"logPath" binding:"required"` AccessIpsAllow string `yaml:"accessIpsAllow" json:"accessIpsAllow" binding:"required"` AccessIpsDeny string `yaml:"accessIpsDeny" json:"accessIpsDeny" binding:"required"` Credential AppCredentialConfig `yaml:"credential" json:"credential" binding:"required"` }
AppConfigure -
type AppCredentialConfig ¶
type AppCredentialConfig struct { ExpiredMs int64 `yaml:"expiredMs" json:"expiredMs" binding:"required"` Urls []string `yaml:"urls" json:"urls" binding:"required"` }
AppCredentialConfig -
type AppServerConfigure ¶
type AppServerConfigure struct { UP bool `yaml:"up" json:"up" binding:"required"` IP string `yaml:"ip" json:"ip" binding:"required"` Port int `yaml:"port" json:"port" binding:"required"` Margic bool `yaml:"margic" json:"margic" binding:"required"` }
AppServerConfigure -
type AppTlsConfigure ¶
type AppTlsConfigure struct { UP bool `yaml:"up" json:"up" binding:"required"` IP string `yaml:"ip" json:"ip" binding:"required"` Port int `yaml:"port" json:"port" binding:"required"` CaCert string `yaml:"cacert" json:"cacert" binding:"required"` CaKey string `yaml:"cakey" json:"cakey" binding:"required"` }
AppTlsConfigure -
type AppWebConfigure ¶
type AppWebConfigure struct { Http AppWebHttpConfigure `yaml:"http" json:"http" binding:"required"` Https AppWebHttpsConfigure `yaml:"https" json:"https" binding:"required"` Static AppWebStaticConfigure `yaml:"static" json:"static" binding:"required"` }
AppWebConfigure -
type AppWebHttpConfigure ¶
type AppWebHttpConfigure struct { UP bool `yaml:"up" json:"up" binding:"required"` Host string `yaml:"host" json:"host" binding:"required"` Heart int32 `yaml:"heart" json:"heart" binding:"required"` }
AppWebHttpConfigure -
type AppWebHttpsConfigure ¶
type AppWebHttpsConfigure struct { UP bool `yaml:"up" json:"up" binding:"required"` Host string `yaml:"host" json:"host" binding:"required"` Heart int32 `yaml:"heart" json:"heart" binding:"required"` CaCert string `yaml:"cacert" json:"cacert" binding:"required"` CaKey string `yaml:"cakey" json:"cakey" binding:"required"` }
AppWebHttpsConfigure -
type AppWebStaticConfigure ¶
type AppWebStaticConfigure struct { UP bool `yaml:"up" json:"up" binding:"required"` UploadPath string `yaml:"uploadPath" json:"uploadPath" binding:"required"` LogPath string `yaml:"logPath" json:"logPath" binding:"required"` Memory int64 `yaml:"memory" json:"memory" binding:"required"` }
AppWebStaticConfigure -
type BytezeroNet ¶
type BytezeroNet struct {
// contains filtered or unexported fields
}
BytezeroNet - BytezeroNet
func NewBytezeroNet ¶
func NewBytezeroNet(ctx context.Context, done chan bool) *BytezeroNet
NewBytezeroNet -
func (*BytezeroNet) AccessIpsAllow ¶
func (bzn *BytezeroNet) AccessIpsAllow(ip string) error
AccessIpsAllow -
func (*BytezeroNet) AccessIpsDeny ¶
func (bzn *BytezeroNet) AccessIpsDeny(ip string) error
AccessIpsDeny -
func (*BytezeroNet) AccessIpsForbid ¶
func (bzn *BytezeroNet) AccessIpsForbid(ip string, deny bool) error
AccessIpsForbid -
func (*BytezeroNet) AccessIpsReload ¶
func (bzn *BytezeroNet) AccessIpsReload(allow bool) error
AccessIpsReload -
func (*BytezeroNet) CredentialExpiredMs ¶
func (bzn *BytezeroNet) CredentialExpiredMs() int64
CredentialExpiredMs -
func (*BytezeroNet) CredentialUrls ¶
func (bzn *BytezeroNet) CredentialUrls() []string
CredentialUrls -
func (*BytezeroNet) HandleConn ¶
func (bzn *BytezeroNet) HandleConn(conn net.Conn) error
HandleConn -
func (*BytezeroNet) HandleConnClose ¶
func (bzn *BytezeroNet) HandleConnClose(connection interface{})
HandleConnClose -
func (*BytezeroNet) HandlePt ¶
func (bzn *BytezeroNet) HandlePt(conn bz.BZNetReceiver, commonPt *protocol.CommonPt) error
HandlePt -
func (*BytezeroNet) MargicV ¶
func (bzn *BytezeroNet) MargicV() (byte, bool)
MargicV - MARGIC_SHIFT for transport secret.
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel -
func (*Channel) Transit ¶
func (c *Channel) Transit(send func(*Connection, *Connection) error)
Transit -
type Configure ¶
type Configure struct {
App AppConfigure `yaml:"app" json:"app" binding:"required"`
}
Configure -
var GlobalConfig Configure
GlobalConfig -
type Connection ¶
type Connection struct { utils.BufferRead net.Conn // Info. DeviceId string SessionId string // contains filtered or unexported fields }
Connection -
func (*Connection) Transit ¶
func (c *Connection) Transit(buf []byte) error
Transit - to connection.
Click to show internal directories.
Click to hide internal directories.