Documentation
¶
Index ¶
- type AppBuilder
- type Application
- func (a *Application) ActorSystem() cfacade.IActorSystem
- func (a *Application) All() []cfacade.IComponent
- func (a *Application) BodyCodecs() cfacade.IBodyCodecRegistry
- func (a *Application) Cluster() cfacade.ICluster
- func (a *Application) DieChan() chan bool
- func (a *Application) Discovery() cfacade.IDiscovery
- func (a *Application) Find(name string) cfacade.IComponent
- func (a *Application) Methods() cfacade.IMethodTable
- func (a *Application) NodeMode() NodeMode
- func (a *Application) OnShutdown(fn ...func())
- func (a *Application) Register(components ...cfacade.IComponent)
- func (a *Application) Remove(name string) cfacade.IComponent
- func (a *Application) Running() bool
- func (a *Application) SetCluster(cluster cfacade.ICluster)
- func (a *Application) SetDefaultBodyCodec(id int32)
- func (a *Application) SetDiscovery(discovery cfacade.IDiscovery)
- func (a *Application) Shutdown()
- func (a *Application) StartTime() string
- func (a *Application) Startup()
- type NodeMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppBuilder ¶
type AppBuilder struct {
*Application
// contains filtered or unexported fields
}
AppBuilder collects components and top-level Actor handlers before the application lifecycle starts.
func Configure ¶
func Configure(profileFilePath, nodeIDStr string, mode NodeMode) *AppBuilder
Configure loads the requested node from a profile and returns its builder.
func ConfigureNode ¶
func ConfigureNode(node cfacade.INode, mode NodeMode) *AppBuilder
ConfigureNode builds an application from a programmatically supplied node.
func (*AppBuilder) AddActors ¶
func (p *AppBuilder) AddActors(actors ...cfacade.IActorHandler)
AddActors queues top-level Actor handlers for creation before listeners start.
func (*AppBuilder) Register ¶
func (p *AppBuilder) Register(component ...cfacade.IComponent)
Register queues components for registration during Startup.
func (*AppBuilder) Startup ¶
func (p *AppBuilder) Startup()
Startup installs the built-in cluster components when required, registers user components, and then enters the blocking application lifecycle.
type Application ¶
Application owns the node configuration and coordinates codecs, components, Actor routing, discovery, and cluster lifecycle.
func NewApp ¶
func NewApp(profileFilePath, nodeIDStr string, mode NodeMode) *Application
NewApp create new application instance It resolves the node entry from the supplied profile before constructing it.
func NewAppNode ¶
func NewAppNode(node cfacade.INode, mode NodeMode) *Application
NewAppNode creates an application from an already resolved node definition.
func (*Application) ActorSystem ¶
func (a *Application) ActorSystem() cfacade.IActorSystem
func (*Application) All ¶
func (a *Application) All() []cfacade.IComponent
func (*Application) BodyCodecs ¶ added in v1.0.20
func (a *Application) BodyCodecs() cfacade.IBodyCodecRegistry
BodyCodecs returns the shared allow-list used by AGP, HTTP, and cluster calls.
func (*Application) Cluster ¶
func (a *Application) Cluster() cfacade.ICluster
func (*Application) DieChan ¶
func (a *Application) DieChan() chan bool
func (*Application) Discovery ¶
func (a *Application) Discovery() cfacade.IDiscovery
func (*Application) Find ¶
func (a *Application) Find(name string) cfacade.IComponent
func (*Application) Methods ¶ added in v1.0.20
func (a *Application) Methods() cfacade.IMethodTable
Methods returns the MethodID-to-Actor route table populated during Actor initialization.
func (*Application) NodeMode ¶
func (a *Application) NodeMode() NodeMode
func (*Application) OnShutdown ¶
func (a *Application) OnShutdown(fn ...func())
func (*Application) Register ¶
func (a *Application) Register(components ...cfacade.IComponent)
func (*Application) Remove ¶
func (a *Application) Remove(name string) cfacade.IComponent
Remove component by name
func (*Application) Running ¶
func (a *Application) Running() bool
func (*Application) SetCluster ¶
func (a *Application) SetCluster(cluster cfacade.ICluster)
SetCluster installs the cross-node transport before the application starts.
func (*Application) SetDefaultBodyCodec ¶ added in v1.0.20
func (a *Application) SetDefaultBodyCodec(id int32)
SetDefaultBodyCodec selects the default body codec before Startup. JSON and protobuf remain registered simultaneously.
func (*Application) SetDiscovery ¶
func (a *Application) SetDiscovery(discovery cfacade.IDiscovery)
SetDiscovery installs discovery before the application starts.
func (*Application) Shutdown ¶
func (a *Application) Shutdown()
func (*Application) StartTime ¶
func (a *Application) StartTime() string
func (*Application) Startup ¶
func (a *Application) Startup()
Startup load components before startup
Directories
¶
| Path | Synopsis |
|---|---|
|
components
|
|
|
gin
Package cgin from https://github.com/gin-contrib/zap/
|
Package cgin from https://github.com/gin-contrib/zap/ |
|
extend
|
|
|
base58
Package file from https://github.com/akamensky/base58/blob/master/base58.go
|
Package file from https://github.com/akamensky/base58/blob/master/base58.go |
|
map
Package file from https://github.com/gogf/gf
|
Package file from https://github.com/gogf/gf |
|
mapstructure
Package exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure.
|
Package exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure. |
|
queue
Package provides an efficient implementation of a multi-producer, single-consumer lock-free queue.
|
Package provides an efficient implementation of a multi-producer, single-consumer lock-free queue. |
|
regex
Package file from https://github.com/gogf/gf
|
Package file from https://github.com/gogf/gf |
|
slice
Package code from: https://github.com/beego/beego/blob/develop/core/utils/slice.go
|
Package code from: https://github.com/beego/beego/blob/develop/core/utils/slice.go |
|
snowflake
Package code from: https://github.com/bwmarrin/snowflake snowflake provides a very simple Twitter snowflake generator and parser.
|
Package code from: https://github.com/bwmarrin/snowflake snowflake provides a very simple Twitter snowflake generator and parser. |
|
sync
Package file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go
|
Package file from https://github.com/beego/beego/blob/develop/core/utils/safemap.go |
|
time
Package code from: https://github.com/golang-module/carbon
|
Package code from: https://github.com/golang-module/carbon |
|
time_wheel
Package file from https://github.com/RussellLuo/timingwheel
|
Package file from https://github.com/RussellLuo/timingwheel |
|
utils
Package file from https://github.com/gogf/gf
|
Package 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
|
|