cores

package
v0.0.0-...-1fcad67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func ConfigSetServer(maxBufferLen, rwBufferLen, port int, host, appid, appkey string, margic bool)

ConfigSetServer -

func ConfigSetTls

func ConfigSetTls(needTls bool, tlsPort int, caCert string, caKey string)

ConfigSetTls -

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 -

func (*AppServerConfigure) Address

func (c *AppServerConfigure) Address() string

Address -

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 -

func (*AppTlsConfigure) Address

func (c *AppTlsConfigure) Address() string

Address -

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 -

func (AppWebHttpConfigure) Address

func (a AppWebHttpConfigure) Address() string

Address -

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 -

func (AppWebHttpsConfigure) Address

func (a AppWebHttpsConfigure) Address() string

Address -

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) AppID

func (bzn *BytezeroNet) AppID() string

AppID -

func (*BytezeroNet) AppKey

func (bzn *BytezeroNet) AppKey() string

AppKey -

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) Main

func (bzn *BytezeroNet) Main()

Main -

func (*BytezeroNet) MargicV

func (bzn *BytezeroNet) MargicV() (byte, bool)

MargicV - MARGIC_SHIFT for transport secret.

func (*BytezeroNet) Quit

func (bzn *BytezeroNet) Quit() bool

Quit -

func (*BytezeroNet) StartTcp

func (bzn *BytezeroNet) StartTcp()

StartTcp -

func (*BytezeroNet) StartTls

func (bzn *BytezeroNet) StartTls()

StartTls -

func (*BytezeroNet) StartUdp

func (bzn *BytezeroNet) StartUdp()

StartUdp -

func (*BytezeroNet) StartWeb

func (bzn *BytezeroNet) StartWeb()

StartWeb -

func (*BytezeroNet) Stats

func (bzn *BytezeroNet) Stats() (interface{}, error)

Stats -

func (*BytezeroNet) SystemReload

func (bzn *BytezeroNet) SystemReload() error

SystemReload -

func (*BytezeroNet) SystemRestart

func (bzn *BytezeroNet) SystemRestart() error

SystemRestart -

func (*BytezeroNet) SystemStop

func (bzn *BytezeroNet) SystemStop() error

SystemStop -

func (*BytezeroNet) Wait

func (bzn *BytezeroNet) Wait()

Wait -

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel -

func NewChannel

func NewChannel() *Channel

NewChannel -

func (*Channel) Ack

func (c *Channel) Ack(code protocol.ErrCode, message string) error

Ack -

func (*Channel) Create

func (c *Channel) Create(lc *Connection) *Channel

Create -

func (*Channel) Join

func (c *Channel) Join(o *Connection) *Channel

Join -

func (*Channel) LeaveAll

func (c *Channel) LeaveAll()

LeaveAll -

func (*Channel) Online

func (c *Channel) Online() bool

Online -

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 -

func ConfigGlobal

func ConfigGlobal() *Configure

ConfigGlobal - 全局实例

func ConfigureParse

func ConfigureParse() (*Configure, error)

ConfigureParse

func NewConfigure

func NewConfigure() *Configure

NewConfigure -

func (Configure) String

func (c Configure) String() string

String -

func (*Configure) Version

func (c *Configure) Version() string

Version -

type Connection

type Connection struct {
	utils.BufferRead
	net.Conn

	// Info.
	DeviceId  string
	SessionId string
	// contains filtered or unexported fields
}

Connection -

func NewConnection

func NewConnection(bzn bz.BZNet, c net.Conn) *Connection

NewConnection -

func (*Connection) ChannId

func (c *Connection) ChannId() string

ChannId -

func (*Connection) Check

func (c *Connection) Check() error

Check -

func (*Connection) Equals

func (c *Connection) Equals(o *Connection) bool

Equal -

func (*Connection) Id

func (c *Connection) Id() string

Id -

func (*Connection) Main

func (c *Connection) Main() *Connection

Main -

func (*Connection) Quit

func (c *Connection) Quit()

Quit -

func (*Connection) Send

func (c *Connection) Send(buf []byte) error

Send -

func (*Connection) Set

Set -

func (Connection) String

func (c Connection) String() string

String -

func (*Connection) Transit

func (c *Connection) Transit(buf []byte) error

Transit - to connection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL