Documentation ¶
Index ¶
- Constants
- func GetSchema() map[string]interface{}
- func LoadMap(document interface{}) (map[string]interface{}, error)
- func ParseMachineType(machineType string) string
- func ValidateJson(schema map[string]interface{}, document map[string]interface{}) (*gojsonschema.Result, error)
- type Graph
- func (g *Graph) Copy() *Graph
- func (g *Graph) FindState(id string) *State
- func (g *Graph) Json() string
- func (g *Graph) JsonMap() map[string]interface{}
- func (g *Graph) String() string
- func (g *Graph) WithState(state State) *Graph
- func (g *Graph) WithStates(states ...State) *Graph
- func (g *Graph) WithTransition(transition Transition) *Graph
- func (g *Graph) WithTransitions(transitions ...Transition) *Graph
- type GraphParams
- type Marshalable
- type State
- type Transition
- type TransitionParams
Constants ¶
View Source
const ( // Deterministic Finite Automaton DFA = "DFA" // Non-Deterministic Finite Automaton NFA = "NFA" // Pushdown Automaton PDA = "PDA" // Turing Machine TM = "TM" )
Machine types
View Source
const SCHEMA = `` /* 2479-byte string literal not displayed */
Compiled version of the schema for use as a default schema - needs to be updated whenever the master copy gets updated
Variables ¶
This section is empty.
Functions ¶
func ParseMachineType ¶
func ValidateJson ¶
func ValidateJson( schema map[string]interface{}, document map[string]interface{}, ) (*gojsonschema.Result, error)
Types ¶
type Graph ¶
type Graph struct { Start *State `json:"Start"` States []State `json:"States"` Transitions []Transition `json:"Transitions"` }
func From ¶
func From(params GraphParams) *Graph
func LoadWithSchema ¶
func NewBlankGraph ¶
func NewBlankGraph() *Graph
func (*Graph) WithStates ¶
func (*Graph) WithTransition ¶
func (g *Graph) WithTransition(transition Transition) *Graph
func (*Graph) WithTransitions ¶
func (g *Graph) WithTransitions(transitions ...Transition) *Graph
type GraphParams ¶
type GraphParams struct { Start string States []State Transitions []TransitionParams }
type Marshalable ¶
Some methods for serializing types
type Transition ¶
type Transition struct { Start *State `json:"Start"` End *State `json:"End"` Symbol string `json:"Symbol"` }
func (Transition) Copy ¶
func (s Transition) Copy() *Transition
func (Transition) Json ¶
func (s Transition) Json() string
func (Transition) JsonMap ¶
func (s Transition) JsonMap() map[string]interface{}
func (Transition) String ¶
func (s Transition) String() string
type TransitionParams ¶
Click to show internal directories.
Click to hide internal directories.