match.go 761 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package fp
  2. import "fmt"
  3. // Match gives the match result for a comparison of a fingerprint to a
  4. // signature.
  5. type Match uint8
  6. // String returns a string represenation of a Match type
  7. func (a Match) String() string {
  8. switch a {
  9. case MatchEmpty:
  10. return "empty"
  11. case MatchImpossible:
  12. return "impossible"
  13. case MatchUnlikely:
  14. return "unlikely"
  15. case MatchPossible:
  16. return "possible"
  17. default:
  18. return fmt.Sprintf("Match(%d)", uint8(a))
  19. }
  20. }
  21. const (
  22. // MatchEmpty is the uninitialized value for a match
  23. MatchEmpty Match = iota
  24. // MatchImpossible means that a match is not possible.
  25. MatchImpossible
  26. // MatchUnlikely means that a match is possible but unlikely.
  27. MatchUnlikely
  28. // MatchPossible means that a match is possible.
  29. MatchPossible
  30. )