mirror of
https://github.com/oarkflow/mq.git
synced 2025-09-27 04:15:52 +08:00
62 lines
862 B
Go
62 lines
862 B
Go
package dag
|
|
|
|
import "time"
|
|
|
|
const (
|
|
Delimiter = "___"
|
|
ContextIndex = "index"
|
|
DefaultChannelSize = 1000
|
|
RetryInterval = 5 * time.Second
|
|
)
|
|
|
|
type NodeType int
|
|
|
|
func (c NodeType) IsValid() bool { return c >= Function && c <= HTTPAPI }
|
|
|
|
func (c NodeType) String() string {
|
|
switch c {
|
|
case Function:
|
|
return "Function"
|
|
case Page:
|
|
return "Page"
|
|
case RPC:
|
|
return "RPC"
|
|
case HTTPAPI:
|
|
return "HTTPAPI"
|
|
}
|
|
return "Function"
|
|
}
|
|
|
|
const (
|
|
Function NodeType = iota
|
|
Page
|
|
RPC
|
|
HTTPAPI
|
|
)
|
|
|
|
type EdgeType int
|
|
|
|
func (c EdgeType) IsValid() bool { return c >= Simple && c <= Iterator }
|
|
|
|
func (c EdgeType) String() string {
|
|
switch c {
|
|
case Simple:
|
|
return "Simple"
|
|
case Iterator:
|
|
return "Iterator"
|
|
}
|
|
return "Simple"
|
|
}
|
|
|
|
const (
|
|
Simple EdgeType = iota
|
|
Iterator
|
|
)
|
|
|
|
type Direction string
|
|
|
|
const (
|
|
TB Direction = "TB"
|
|
LR Direction = "LR"
|
|
)
|