From c976de20df04f8bc5e183ee272c52b06e30a5217 Mon Sep 17 00:00:00 2001 From: maze Date: Thu, 9 Oct 2025 12:45:30 +0200 Subject: [PATCH] Added documentation for the protocol package --- protocol/doc.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 protocol/doc.go diff --git a/protocol/doc.go b/protocol/doc.go new file mode 100644 index 0000000..de62e27 --- /dev/null +++ b/protocol/doc.go @@ -0,0 +1,19 @@ +// Package protocol contains functions for performing protocol detection. +// +// # Confidence scores +// +// All registered detectors in this package shall output a confidence score. If there are multiple +// matching protocols, the protocol with the highest confidence score will be returned to the +// caller. +// +// Confidence scores should be between 0 and 0.99, but there is no hard enforcement of this range +// in this package. +// +// # Protocol matching +// +// The first level matching happens with magic strings, as inspired by Go's [image.RegisterFormat] +// function. The only addition that this package has made, is that you can also use the '*' +// character for wildcard matching. +// +// The supported magic strings input is documented in the [Match] function. +package protocol