Documentation ¶
Index ¶
- Variables
- type ProcessStateManager
- func (psm *ProcessStateManager) CompleteSession(sessionName string)
- func (psm *ProcessStateManager) GetSession(sessionName string) (bool, bool)
- func (psm *ProcessStateManager) IsPairing() bool
- func (psm *ProcessStateManager) RegisterSession(sessionName string)
- func (psm *ProcessStateManager) SetPairing(state bool)
- func (psm *ProcessStateManager) StartPairing(sessionName string) error
- func (psm *ProcessStateManager) StopPairing(sessionName string, err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ProcessStateManager ¶
type ProcessStateManager struct {
// contains filtered or unexported fields
}
ProcessStateManager represents a g
func (*ProcessStateManager) CompleteSession ¶
func (psm *ProcessStateManager) CompleteSession(sessionName string)
CompleteSession updates a transfer session with a given transfer success state only if the session is registered.
func (*ProcessStateManager) GetSession ¶
func (psm *ProcessStateManager) GetSession(sessionName string) (bool, bool)
GetSession returns two booleans for a given sessionName. These represent if the sessionName has been registered and if it has resulted in a successful transfer
func (*ProcessStateManager) IsPairing ¶
func (psm *ProcessStateManager) IsPairing() bool
IsPairing returns if the ProcessStateManager is currently in pairing mode
func (*ProcessStateManager) RegisterSession ¶
func (psm *ProcessStateManager) RegisterSession(sessionName string)
RegisterSession stores a sessionName with the default false value. In practice a sessionName will be a ConnectionParams string provided by the server mode device. The boolean value represents whether the ConnectionParams string session resulted in a successful transfer.
func (*ProcessStateManager) SetPairing ¶
func (psm *ProcessStateManager) SetPairing(state bool)
SetPairing sets the ProcessStateManager pairing state
func (*ProcessStateManager) StartPairing ¶
func (psm *ProcessStateManager) StartPairing(sessionName string) error
StartPairing along with StopPairing are the core functions of the ProcessStateManager This function takes a sessionName, which in practice is a ConnectionParams string, and attempts to init pairing state management. The function will return an error if the ProcessStateManager is already currently pairing or if the sessionName was previously successful.
func (*ProcessStateManager) StopPairing ¶
func (psm *ProcessStateManager) StopPairing(sessionName string, err error)
StopPairing takes a sessionName and an error, if the error is nil the sessionName will be recorded as successful the pairing state of the ProcessStateManager is set to false.