package states
import (
am "github.com/pancsta/asyncmachine-go/pkg/machine"
ss "github.com/pancsta/asyncmachine-go/pkg/states"
. "github.com/pancsta/asyncmachine-go/pkg/states/global"
)
type ServerStatesDef struct {
*am .StatesBase
Ready string
RpcStarting string
RpcAccepting string
RpcReady string
ClientConnected string
HandshakeDone string
MetricSync string
WebSocketTunnel string
*ss .BasicStatesDef
}
type ServerGroupsDef struct {
Rpc S
}
var ServerSchema = ss .BasicSchema .Merge (
am .Schema {
ssS .ErrNetwork : {
Require : S {am .StateException },
Remove : S {ssS .ClientConnected },
},
ssS .HandshakeDone : {
Require : S {ssS .ClientConnected },
Remove : S {Exception },
},
ssS .Start : {Add : S {ssS .RpcStarting }},
ssS .Ready : {
Auto : true ,
Require : S {ssS .HandshakeDone , ssS .RpcReady },
},
ssS .RpcStarting : {
Require : S {ssS .Start },
Remove : sgS .Rpc ,
},
ssS .RpcAccepting : {
Require : S {ssS .Start },
Remove : sgS .Rpc ,
},
ssS .RpcReady : {
Require : S {ssS .Start },
Remove : sgS .Rpc ,
},
ssS .ClientConnected : {
Require : S {ssS .RpcReady },
},
ssS .MetricSync : {Multi : true },
ssS .WebSocketTunnel : {},
})
var (
ssS = am .NewStates (ServerStatesDef {})
sgS = am .NewStateGroups (ServerGroupsDef {
Rpc : S {ssS .RpcStarting , ssS .RpcAccepting , ssS .RpcReady },
})
ServerStates = ssS
ServerGroups = sgS
)
The pages are generated with Golds v0.8.4 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .