package states
import (
am "github.com/pancsta/asyncmachine-go/pkg/machine"
ssam "github.com/pancsta/asyncmachine-go/pkg/states"
. "github.com/pancsta/asyncmachine-go/pkg/states/global"
ssdbg "github.com/pancsta/asyncmachine-go/tools/debugger/states"
)
type RelayStatesDef struct {
*am .StatesBase
HttpStarting string
HttpReady string
WsTunListenConn string
WsTunListenDisconn string
*ssam .BasicStatesDef
*ssam .DisposedStatesDef
*ssdbg .ServerStatesDef
}
type RelayGroupsDef struct {
}
var RelaySchema = SchemaMerge (
ssam .BasicSchema ,
ssam .DisposedSchema ,
ssdbg .ServerSchema ,
am .Schema {
ss .HttpStarting : {
Require : S {ss .Start },
Remove : S {ss .HttpReady },
},
ss .HttpReady : {
Require : S {ss .Start },
Remove : S {ss .HttpStarting },
},
ss .WsTunListenConn : {
Multi : true ,
Require : S {ss .HttpReady },
},
ss .WsTunListenDisconn : {
Multi : true ,
Require : S {ss .HttpReady },
},
})
var (
ss = am .NewStates (RelayStatesDef {})
sg = am .NewStateGroups (RelayGroupsDef {})
RelayStates = ss
RelayGroups = sg
)
type WsTcpTunStatesDef struct {
*am .StatesBase
ErrClient string
ErrServer string
WebSocket string
TcpListen string
TcpListening string
TcpAccepted string
*ssam .DisposedStatesDef
*ssam .BasicStatesDef
}
type WsTcpTunGroupsDef struct {
}
var WsTcpTunSchema = SchemaMerge (
ssam .DisposedSchema ,
ssam .BasicSchema ,
am .Schema {
ssW .ErrClient : {
Add : S {ssW .Disposing },
Require : S {Exception },
},
ssW .ErrServer : {
Add : S {ssW .Disposing },
Require : S {Exception },
},
ssW .WebSocket : {},
ssW .Start : {Add : S {ssW .TcpListen , ssW .WebSocket }},
ssW .TcpListen : {
Require : S {ssW .WebSocket },
Remove : S {ssW .TcpListening },
},
ssW .TcpListening : {
Require : S {ssW .Start , ssW .WebSocket },
Remove : S {ssW .TcpListen },
},
ssW .TcpAccepted : {
Add : S {ssW .Ready },
Require : S {ssW .TcpListening },
},
ssW .Ready : {Require : S {ssW .TcpAccepted }},
})
var (
ssW = am .NewStates (WsTcpTunStatesDef {})
sgW = am .NewStateGroups (WsTcpTunGroupsDef {})
WsTcpTunStates = ssW
WsTcpTunGroups = sgW
)
The pages are generated with Golds v0.8.2 . (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 .