Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer interface { Head(path string, scanned, created time.Time, version [3]int, ids [][2]string, fields [][]string, hh string) // path := filepath.Base(path) File(name string, sz int64, mod string, checksum []byte, err error, ids []core.Identification) // if a directory give a negative sz Tail() }
func JSON ¶
Example ¶
js := JSON(ioutil.Discard) js.Head("", time.Time{}, time.Time{}, [3]int{}, [][2]string{{"pronom", ""}}, [][]string{makeFields()}, "") js.(*jsonWriter).w = bufio.NewWriter(os.Stdout) js.File("example.doc", 1, "2015-05-24T16:59:13+10:00", nil, testErr{}, []core.Identification{testID{}}) js.Tail()
Output: {"filename":"example.doc","filesize": 1,"modified":"2015-05-24T16:59:13+10:00","errors": "mscfb: bad OLE","matches": [{"ns":"pronom","id":"fmt/43","format":"JPEG File Interchange Format","version":"1.01","mime":"image/jpeg","basis":"extension match jpg; byte match at [[[0 14]] [[75201 2]]]","warning":""}]}]}
func YAML ¶
Example ¶
yml := YAML(ioutil.Discard) yml.Head("", time.Time{}, time.Time{}, [3]int{}, [][2]string{{"pronom", ""}}, [][]string{makeFields()}, "") yml.(*yamlWriter).w = bufio.NewWriter(os.Stdout) yml.File("example.doc", 1, "2015-05-24T16:59:13+10:00", nil, testErr{}, []core.Identification{testID{}}) yml.Tail()
Output: --- filename : 'example.doc' filesize : 1 modified : 2015-05-24T16:59:13+10:00 errors : 'mscfb: bad OLE' matches : - ns : 'pronom' id : 'fmt/43' format : 'JPEG File Interchange Format' version : '1.01' mime : 'image/jpeg' basis : 'extension match jpg; byte match at [[[0 14]] [[75201 2]]]' warning :
Click to show internal directories.
Click to hide internal directories.