View Source MimeSniff.Signatures.Signature protocol (mime_sniff v0.1.0)

This protocol defines the API for Struct to be implemented in order to use with matching signature function.

There are some out-of-the-box predefine signature such as MimeSniff.Signatures.ExactSignature and MimeSniff.Signatures.MaskedSignature. Please visit them for more infomation and examples.

Link to this section Summary

Functions

Perform the matching with binary data by matching algorithm define in signature.

Link to this section Types

Link to this section Functions

@spec match(signature :: term(), data :: binary()) ::
  {:ok, String.t()} | {:error, reason :: atom()}

Perform the matching with binary data by matching algorithm define in signature.