status-keycard-go/flow_types.go

62 lines
1.1 KiB
Go
Raw Normal View History

package statuskeycardgo
2021-10-14 13:14:43 +03:00
type FlowType int
2021-10-18 10:19:09 +03:00
type FlowParams map[string]interface{}
type FlowStatus map[string]interface{}
2021-10-15 10:35:01 +03:00
type runState int
2021-10-14 13:14:43 +03:00
2021-10-18 15:47:27 +03:00
type restartError struct{}
func restartErr() (e *restartError) {
return &restartError{}
}
func (e *restartError) Error() string {
return "restart"
}
2021-10-14 13:14:43 +03:00
const (
2021-10-15 12:38:06 +03:00
GetAppInfo FlowType = iota
2021-10-15 10:35:01 +03:00
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-15 12:38:06 +03:00
SwapCard = "keycard.action.swap-card"
2021-10-19 12:19:02 +03:00
EnterPairing = "keycard.action.enter-pairing"
EnterPIN = "keycard.action.enter-pin"
2021-10-15 12:38:06 +03:00
)
const (
ErrorKey = "error"
ErrorOK = "ok"
ErrorCancel = "cancel"
ErrorConnection = "connection-error"
ErrorUnknownFlow = "unknown-flow"
2021-10-18 14:50:56 +03:00
ErrorNotAKeycard = "not-a-keycard"
2021-10-15 12:38:06 +03:00
)
const (
AppInfo = "application-info"
InstanceUID = "instance-uid"
KeyUID = "key-uid"
2021-10-19 12:19:02 +03:00
PairingPass = "pairing-pass"
2021-10-14 13:14:43 +03:00
)