Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiniApp ¶ added in v0.2.6
func MiniApp(ctx context.Context, timeout time.Duration, servers ...Server) (run, stop func() error)
MiniApp provides a simplified way to run multiple servers with lifecycle management. It returns a run function that starts all servers and a stop function to gracefully shut them down. If timeout > 0, the context will be cancelled after the timeout duration.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the application with a universal mechanism to manage goroutine lifecycles.
func (*App) AppConfiguration ¶
func (a *App) AppConfiguration() *conf.AppConfiguration
func (*App) RegisterServer ¶
type Group ¶ added in v0.7.4
type Group struct {
// contains filtered or unexported fields
}
Group collects actors (functions) and runs them concurrently. When one actor (function) returns, all actors are interrupted. The zero value of a Group is useful.
func (*Group) Add ¶ added in v0.7.4
Add an actor (function) to the group. Each actor must be pre-emptable by an interrupt function. That is, if interrupt is invoked, execute should return. Also, it must be safe to call interrupt even after execute has returned.
The first actor (function) to return interrupts all running actors. The error is passed to the interrupt functions, and is returned by Run.
type Option ¶
type Option func(o *options)
func WithAppConfiguration ¶
func WithAppConfiguration(cnf *conf.Configuration) Option
WithAppConfiguration set up the configuration of the web server by a configuration instance
func WithInterval ¶ added in v0.5.0
WithInterval controls the interval time for App starting every server with time.Sleep if servers have some dependencies.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
woco
module
|
|
|
contrib
|
|
|
etcd
module
|
|
|
gql
module
|
|
|
opentelemetry
module
|
|
|
polarismesh
module
|
|
|
telemetry
module
|
|
|
examples
|
|
|
hello-web
module
|
|
|
pkg
|
|
|
gds/timeinterval
Package timeinterval is time range data structure ,many trade system has this.
|
Package timeinterval is time range data structure ,many trade system has this. |
|
rpc
|
|
|
test
|
|