Documentation ¶
Index ¶
- Constants
- type Application
- func (app *Application) Broadcast(serverType, route string, data []byte)
- func (app *Application) GetConnectionOption(serverType string) *option.ConnectorOption
- func (app *Application) GetDB(name string) *sql.DB
- func (app *Application) GetRpcClient(serverType string) *grpc.ClientConn
- func (app *Application) HandleFunc(name string, handler func(*hub.Session, []byte) []byte)
- func (app *Application) IsMaster() bool
- func (app *Application) RegisterBeforeHandler(handler func(*hub.Session, string) error)
- func (app *Application) RegisterDB(name, dbType, dsn string)
- func (app *Application) RegisterHandler(name string)
- func (app *Application) RegisterRPC(handler func())
- func (app *Application) Route(serverType string, handler func(session *hub.Session) string)
- func (app *Application) Run()
- func (app *Application) SetConfigPath(path string)
- func (app *Application) SetConnectionOption(serverType string, option *option.ConnectorOption)
- func (app *Application) SetLogPath(path string)
- type EnumState
Constants ¶
View Source
const (
SERVER_MASTER = "master"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func CreateApp ¶
func CreateApp() *Application
func GetApp ¶
func GetApp() *Application
func (*Application) Broadcast ¶
func (app *Application) Broadcast(serverType, route string, data []byte)
func (*Application) GetConnectionOption ¶
func (app *Application) GetConnectionOption(serverType string) *option.ConnectorOption
func (*Application) GetRpcClient ¶
func (app *Application) GetRpcClient(serverType string) *grpc.ClientConn
func (*Application) HandleFunc ¶
func (*Application) IsMaster ¶
func (app *Application) IsMaster() bool
func (*Application) RegisterBeforeHandler ¶
func (app *Application) RegisterBeforeHandler(handler func(*hub.Session, string) error)
func (*Application) RegisterDB ¶
func (app *Application) RegisterDB(name, dbType, dsn string)
func (*Application) RegisterHandler ¶
func (app *Application) RegisterHandler(name string)
func (*Application) RegisterRPC ¶
func (app *Application) RegisterRPC(handler func())
func (*Application) Route ¶
func (app *Application) Route(serverType string, handler func(session *hub.Session) string)
func (*Application) Run ¶
func (app *Application) Run()
func (*Application) SetConfigPath ¶
func (app *Application) SetConfigPath(path string)
func (*Application) SetConnectionOption ¶
func (app *Application) SetConnectionOption(serverType string, option *option.ConnectorOption)
func (*Application) SetLogPath ¶
func (app *Application) SetLogPath(path string)
Click to show internal directories.
Click to hide internal directories.