Documentation ¶
Index ¶
- func AddNodeRouter(nodeType string, routingFunc cherryRouter.RoutingFunc)
- func Configure(profilePath, profileName, nodeId string) cherryFacade.IApplication
- func GetCluster() *cherryCluster.Component
- func GetConnector() *cherryConnector.Component
- func GetRPCClient() cherryFacade.RPCClient
- func PostEvent(event cherryFacade.IEvent)
- func RPC(nodeId string, route string, arg proto.Message, reply proto.Message, ...) int32
- func RPCAsync(nodeId string, route string, arg proto.Message)
- func RPCAsyncByNodeType(nodeType string, route string, arg proto.Message, filterNodeId ...string)
- func RPCAsyncByRoute(route string, arg proto.Message)
- func RPCByRoute(route string, arg proto.Message, reply proto.Message, timeout ...time.Duration) int32
- func RegisterCommand(command cherryCommand.ICommand)
- func RegisterComponent(component ...cherryFacade.IComponent)
- func RegisterConnector(connector cherryFacade.IConnector)
- func RegisterHandler(handler ...cherryFacade.IHandler)
- func RegisterHandlerGroup(group ...*cherryHandler.HandlerGroup)
- func Run(isFrontend bool, nodeMode NodeMode)
- func SetDictionary(dict map[string]uint16)
- func SetHandlerOptions(opts ...cherryHandler.Option)
- func SetHandshake(key string, value interface{})
- func SetHeartbeat(time time.Duration)
- func SetMessageCompression(compression bool)
- func SetOnShutdown(fn ...func())
- func SetPacketCodec(codec cherryFacade.IPacketCodec)
- func SetSerializer(serializer cherryFacade.ISerializer)
- type Application
- func (a *Application) All() []facade.IComponent
- func (a *Application) DieChan() chan bool
- func (a *Application) Find(name string) facade.IComponent
- func (a *Application) IsFrontend() bool
- func (a *Application) NodeMode() NodeMode
- func (a *Application) OnShutdown(fn ...func())
- func (a *Application) Register(components ...facade.IComponent)
- func (a *Application) Remove(name string) facade.IComponent
- func (a *Application) Running() bool
- func (a *Application) SetPacketCodec(codec facade.IPacketCodec)
- func (a *Application) SetSerializer(serializer facade.ISerializer)
- func (a *Application) Shutdown()
- func (a *Application) StartTime() string
- func (a *Application) Startup(components ...facade.IComponent)
- type NodeMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNodeRouter ¶ added in v1.1.9
func AddNodeRouter(nodeType string, routingFunc cherryRouter.RoutingFunc)
func Configure ¶ added in v1.1.5
func Configure(profilePath, profileName, nodeId string) cherryFacade.IApplication
func GetCluster ¶ added in v1.1.20
func GetCluster() *cherryCluster.Component
func GetConnector ¶ added in v1.1.21
func GetConnector() *cherryConnector.Component
func GetRPCClient ¶ added in v1.1.20
func GetRPCClient() cherryFacade.RPCClient
func PostEvent ¶ added in v1.1.22
func PostEvent(event cherryFacade.IEvent)
func RPCAsyncByNodeType ¶ added in v1.1.20
func RPCAsyncByRoute ¶ added in v1.1.20
func RPCByRoute ¶ added in v1.1.20
func RegisterCommand ¶ added in v1.1.5
func RegisterCommand(command cherryCommand.ICommand)
func RegisterComponent ¶ added in v1.1.5
func RegisterComponent(component ...cherryFacade.IComponent)
func RegisterConnector ¶ added in v1.1.5
func RegisterConnector(connector cherryFacade.IConnector)
func RegisterHandler ¶ added in v1.1.5
func RegisterHandler(handler ...cherryFacade.IHandler)
func RegisterHandlerGroup ¶ added in v1.1.5
func RegisterHandlerGroup(group ...*cherryHandler.HandlerGroup)
func SetDictionary ¶ added in v1.1.5
func SetHandlerOptions ¶ added in v1.1.5
func SetHandlerOptions(opts ...cherryHandler.Option)
func SetHandshake ¶ added in v1.1.5
func SetHandshake(key string, value interface{})
func SetHeartbeat ¶ added in v1.1.5
func SetMessageCompression ¶ added in v1.1.5
func SetMessageCompression(compression bool)
func SetOnShutdown ¶ added in v1.1.5
func SetOnShutdown(fn ...func())
func SetPacketCodec ¶ added in v1.1.5
func SetPacketCodec(codec cherryFacade.IPacketCodec)
func SetSerializer ¶ added in v1.1.5
func SetSerializer(serializer cherryFacade.ISerializer)
Types ¶
type Application ¶
type Application struct { facade.INode facade.ISerializer facade.IPacketCodec // contains filtered or unexported fields }
func App ¶ added in v1.1.3
func App() *Application
func NewApp ¶
func NewApp(profilePath, profileName, nodeId string) *Application
NewApp create new application instance
func (*Application) All ¶
func (a *Application) All() []facade.IComponent
func (*Application) DieChan ¶ added in v1.1.22
func (a *Application) DieChan() chan bool
func (*Application) Find ¶
func (a *Application) Find(name string) facade.IComponent
func (*Application) IsFrontend ¶ added in v1.1.6
func (a *Application) IsFrontend() bool
func (*Application) NodeMode ¶ added in v1.1.6
func (a *Application) NodeMode() NodeMode
func (*Application) OnShutdown ¶ added in v1.1.0
func (a *Application) OnShutdown(fn ...func())
func (*Application) Register ¶ added in v1.1.5
func (a *Application) Register(components ...facade.IComponent)
func (*Application) Remove ¶
func (a *Application) Remove(name string) facade.IComponent
Remove remove component by name
func (*Application) Running ¶
func (a *Application) Running() bool
func (*Application) SetPacketCodec ¶ added in v1.1.0
func (a *Application) SetPacketCodec(codec facade.IPacketCodec)
func (*Application) SetSerializer ¶ added in v1.1.0
func (a *Application) SetSerializer(serializer facade.ISerializer)
func (*Application) Shutdown ¶
func (a *Application) Shutdown()
func (*Application) StartTime ¶ added in v1.1.0
func (a *Application) StartTime() string
func (*Application) Startup ¶
func (a *Application) Startup(components ...facade.IComponent)
Startup load components before startup
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
component
|
|
gin
Package cherryGin from https://github.com/gin-contrib/zap/
|
Package cherryGin from https://github.com/gin-contrib/zap/ |
components
|
|
cron
Module
|
|
data-config
Module
|
|
etcd
Module
|
|
gin
Module
|
|
gops
Module
|
|
gorm
Module
|
|
mongo
Module
|
|
examples
module
|
|
extend
|
|
map
Package cherryMap file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go Package cherryMap file from https://github.com/gogf/gf
|
Package cherryMap file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go Package cherryMap file from https://github.com/gogf/gf |
mapstructure
Package cherryMapStructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure.
|
Package cherryMapStructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure. |
regex
Package cherryRegex file from https://github.com/gogf/gf
|
Package cherryRegex file from https://github.com/gogf/gf |
slice
Package cherrySlice code from: https://github.com/beego/beego/blob/develop/core/utils/slice.go
|
Package cherrySlice code from: https://github.com/beego/beego/blob/develop/core/utils/slice.go |
snowflake
Package cherrySnowflake code from: https://github.com/bwmarrin/snowflake snowflake provides a very simple Twitter snowflake generator and parser.
|
Package cherrySnowflake code from: https://github.com/bwmarrin/snowflake snowflake provides a very simple Twitter snowflake generator and parser. |
sync
Package cherrySync cherrySync file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go
|
Package cherrySync cherrySync file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go |
time
Package cherryTime code from: https://github.com/golang-module/carbon
|
Package cherryTime code from: https://github.com/golang-module/carbon |
utils
Package cherryUtils file from https://github.com/gogf/gf Package cherryUtils file from https://github.com/gogf/gf Package cherryUtils file from https://github.com/gogf/gf
|
Package cherryUtils file from https://github.com/gogf/gf Package cherryUtils file from https://github.com/gogf/gf Package cherryUtils file from https://github.com/gogf/gf |
rotatelogs
Package rotatelogs is a port of File-RotateLogs from Perl (https://metacpan.org/release/File-RotateLogs), and it allows you to automatically rotate output files when you write to them according to the filename pattern that you can specify.
|
Package rotatelogs is a port of File-RotateLogs from Perl (https://metacpan.org/release/File-RotateLogs), and it allows you to automatically rotate output files when you write to them according to the filename pattern that you can specify. |
net
|
|
Click to show internal directories.
Click to hide internal directories.