status-keycard-go/flow_types.go

39 lines
550 B
Go
Raw Normal View History

2021-10-14 13:14:43 +03:00
package main
type FlowType int
2021-10-15 10:35:01 +03:00
type runState int
2021-10-14 13:14:43 +03:00
const (
2021-10-15 10:35:01 +03:00
GetStatus FlowType = iota
RecoverAccount
LoadAccount
Login
Sign
ChangeCredentials
UnpairThis
UnpairOthers
DeleteAccountAndUnpair
2021-10-14 13:14:43 +03:00
)
const (
2021-10-15 10:35:01 +03:00
Idle runState = iota
Running
Paused
Resuming
Cancelling
)
const (
FlowResult = "keycard.flow-result"
InsertCard = "keycard.action.insert-card"
CardInserted = "keycard.action.card-inserted"
2021-10-14 13:14:43 +03:00
)
type keycardFlow struct {
flowType FlowType
2021-10-15 10:35:01 +03:00
state runState
2021-10-14 13:14:43 +03:00
wakeUp chan (struct{})
storage string
params map[string]string
}