1
0
Fork 0

Chain flaw

This commit is contained in:
Gregory Eremin 2015-02-11 01:15:52 +07:00
parent 512770b91a
commit cc75f8cbac
1 changed files with 39 additions and 0 deletions

39
core/flow.go Normal file
View File

@ -0,0 +1,39 @@
package core
type (
Flow int
)
const (
UnknownFlow Flow = iota
SequentialFlow
ParallelFlow
DelayedFlow
)
var (
flowSymbols = map[string]Flow{
"s": SequentialFlow,
"p": ParallelFlow,
"d": DelayedFlow,
}
flowNames = map[Flow]string{
UnknownFlow: "Unknown",
SequentialFlow: "Sequential",
ParallelFlow: "Parallel",
DelayedFlow: "Delayed",
}
)
func FlowOf(f string) Flow {
if flow, ok := flowSymbols[f]; ok {
return flow
} else {
return UnknownFlow
}
}
func (f Flow) String() string {
name, _ := flowNames[f]
return name
}