File: binary.go

package info (click to toggle)
wuzz 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 372 kB
  • sloc: makefile: 6
file content (28 lines) | stat: -rw-r--r-- 504 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package formatter

import (
	"encoding/hex"
	"errors"
	"fmt"
	"io"
)

type binaryFormatter struct {
}

func (f *binaryFormatter) Format(writer io.Writer, data []byte) error {
	fmt.Fprint(writer, hex.Dump(data))
	return nil
}

func (f *binaryFormatter) Title() string {
	return "[binary]"
}

func (f *binaryFormatter) Searchable() bool {
	return false
}

func (f *binaryFormatter) Search(q string, body []byte) ([]string, error) {
	return nil, errors.New("Cannot perform search on binary content type")
}