Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.dll
*.so
*.dylib
bin/

# Test binary, built with `go test -c`
*.test
Expand Down
32 changes: 32 additions & 0 deletions artifact.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package brief

import "github.com/git-pkgs/brief/binary"

// Artifact is the output of inspecting a distributed package archive or a
// bare native object file.
type Artifact struct {
Version string `json:"version"`
Path string `json:"path"`

// Format is the physical container format as reported by
// git-pkgs/magic: "zip", "gzip", "tar", "elf", "mach-o", "pe".
// Packaging-level identity (wheel, gem, jar) is added by later
// container metadata parsing.
Format string `json:"format"`

// SHA256 is the hex-encoded digest of the raw input file.
SHA256 string `json:"sha256,omitempty"`

// Entries is the total number of regular-file entries walked when the
// input is an archive. Zero for bare native objects.
Entries int `json:"entries,omitempty"`

// NativeObjects lists every ELF, Mach-O, or PE object found: the input
// itself when it is a bare native object, or each such entry inside an
// archive.
NativeObjects []binary.Object `json:"native_objects,omitempty"`

// DurationMS is wall-clock milliseconds spent producing the report,
// excluding archive download time.
DurationMS float64 `json:"duration_ms"`
}
Loading