package states
import (
am "github.com/pancsta/asyncmachine-go/pkg/machine"
. "github.com/pancsta/asyncmachine-go/pkg/states/global"
)
type ConnectedStatesDef struct {
*am .StatesBase
ErrConnecting string
Connecting string
Connected string
Disconnecting string
Disconnected string
}
type ConnectedGroupsDef struct {
Connected S
}
var ConnectedSchema = am .Schema {
ssC .ErrConnecting : {Require : S {Exception }},
ssC .Connecting : {
Require : S {Start },
Remove : sgC .Connected ,
},
ssC .Connected : {
Require : S {Start },
Remove : sgC .Connected ,
},
ssC .Disconnecting : {Remove : sgC .Connected },
ssC .Disconnected : {
Auto : true ,
Remove : sgC .Connected ,
},
}
var (
ssC = am .NewStates (ConnectedStatesDef {})
sgC = am .NewStateGroups (ConnectedGroupsDef {
Connected : S {
ssC .Connecting , ssC .Connected , ssC .Disconnecting ,
ssC .Disconnected ,
},
})
ConnectedStates = ssC
ConnectedGroups = sgC
)
type ConnPoolStatesDef struct {
ErrConnecting string
Connecting string
Connected string
ConnectedFully string
Disconnecting string
Disconnected string
*am .StatesBase
}
type ConnPoolGroupsDef struct {
Connected S
}
var ConnPoolSchema = am .Schema {
ssPc .ErrConnecting : {Require : S {Exception }},
ssPc .Disconnected : {
Remove : S {ssPc .Connecting , ssPc .ConnectedFully , ssPc .Disconnecting },
},
ssPc .Connecting : {
Require : S {Start },
Remove : S {ssPc .Disconnecting },
},
ssPc .Connected : {
Require : S {Start },
Remove : S {ssPc .Disconnected },
},
ssPc .ConnectedFully : {
Require : S {ssPc .Connected },
Remove : S {ssPc .Disconnected },
},
ssPc .Disconnecting : {
Remove : S {ssPc .ConnectedFully , ssPc .Connected , ssPc .Connecting },
},
}
var (
ssPc = am .NewStates (ConnPoolStatesDef {})
sgCp = am .NewStateGroups (ConnPoolGroupsDef {
Connected : S {ssPc .Connected , ssPc .Disconnected },
})
ConnPoolStates = ssPc
ConnPoolGroups = sgCp
)
The pages are generated with Golds v0.8.7 . (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 .