1 package pin 2 3 import "context" 4 5 type Data struct { 6 Subject string `json:"sub"` 7 Hash string `json:"hash"` 8 LastUpdated int64 `json:"last_updated"` 9 NumOfWrongAttempts int8 `json:"num_of_wrong_attempts"` 10 PreviousPins []string `json:"previous_pins"` 11 } 12 13 type Storage interface { 14 SavePIN(ctx context.Context, userID string, pin string) error 15 LoginWithPIN(ctx context.Context, userID string, pin string) (*Data, error) 16 IsOffline() bool 17 } 18