summaryrefslogtreecommitdiff
path: root/internal/fsm/fsm.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 14:29:12 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 14:29:12 +0100
commit0bfb35520d7e138e6219e550187e0b55bc8a29ac (patch)
treea087049edae0ff932bc7a14fef323783b26a2ff1 /internal/fsm/fsm.go
parent59e6ccd051452162fab852a25deb4f0f8a9e22b2 (diff)
Formatting: Run gofumpt -w
Diffstat (limited to 'internal/fsm/fsm.go')
-rw-r--r--internal/fsm/fsm.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/fsm/fsm.go b/internal/fsm/fsm.go
index 4114a32..0163fed 100644
--- a/internal/fsm/fsm.go
+++ b/internal/fsm/fsm.go
@@ -8,12 +8,13 @@ import (
"os/exec"
"path"
"sort"
+
"github.com/eduvpn/eduvpn-common/types"
)
type (
// StateID represents the Identifier of the state.
- StateID int8
+ StateID int8
// StateIDSlice represents the list of state identifiers.
StateIDSlice []StateID
)
@@ -33,7 +34,7 @@ func (v StateIDSlice) Swap(i, j int) {
// Transition indicates an arrow in the state graph.
type Transition struct {
// To represents the to-be-new state
- To StateID
+ To StateID
// Description is what type of message the arrow gets in the graph
Description string
}
@@ -51,26 +52,26 @@ type State struct {
// FSM represents the total graph.
type FSM struct {
// States is the map from state ID to states
- States States
+ States States
// Current is the current state represented by the identifier
Current StateID
// Name represents the descriptive name of this state machine
- Name string
+ Name string
// StateCallback is the function ran when a transition occurs
// It takes the old state, the new state and the data and returns if this is handled by the client
StateCallback func(StateID, StateID, interface{}) bool
// Directory represents the path where the state graph is stored
- Directory string
+ Directory string
// Generate represents whether we want to generate the graph
- Generate bool
+ Generate bool
// GetStateName gets the name of a state as a string
- GetStateName func(StateID) string
+ GetStateName func(StateID) string
}
// Init initializes the state machine and sets it to the given current state.