From 74e36f0ead717105f26087c2cab08b41ba5a7ce8 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 12 Feb 2024 19:18:05 +0100 Subject: All: Document everything to pass revive lint --- client/fsm.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'client/fsm.go') diff --git a/client/fsm.go b/client/fsm.go index 42c0029..175b832 100644 --- a/client/fsm.go +++ b/client/fsm.go @@ -9,9 +9,13 @@ import ( ) type ( - FSMStateID = fsm.StateID - FSMStates = fsm.States - FSMState = fsm.State + // FSMStateID is an alias to the fsm state ID type + FSMStateID = fsm.StateID + // FSMStates is an alias to the fsm states type + FSMStates = fsm.States + // FSMState is an alias to the fsm state type + FSMState = fsm.State + // FSMTransition is an alias to the fsm transition type FSMTransition = fsm.Transition ) @@ -53,6 +57,7 @@ const ( StateDisconnected ) +// GetStateName gets the State name for state `s` func GetStateName(s FSMStateID) string { switch s { case StateDeregistered: @@ -166,6 +171,7 @@ func newFSM( return returnedFSM } +// SetState sets the state for the client FSM to `state` func (c *Client) SetState(state FSMStateID) error { c.mu.Lock() defer c.mu.Unlock() @@ -182,6 +188,7 @@ func (c *Client) SetState(state FSMStateID) error { return nil } +// InState returns whether or not the client is in state `state` func (c *Client) InState(state FSMStateID) bool { c.mu.Lock() defer c.mu.Unlock() -- cgit v1.2.3