Initial import

This commit is contained in:
2025-10-08 20:53:56 +02:00
commit 2081d684ed
25 changed files with 3486 additions and 0 deletions

26
error.go Normal file
View File

@@ -0,0 +1,26 @@
package dpi
import (
"errors"
"fmt"
)
var (
ErrInvalid = errors.New("invalid")
)
type DecodeError struct {
Reason string
Err error
}
func (err DecodeError) Error() string {
if err.Reason != "" {
return fmt.Sprintf("dpi: %s: %v", err.Reason, err.Err.Error())
}
return err.Error()
}
func (err DecodeError) Unwrap() error {
return err.Err
}