types

package
v0.0.0-...-304c307 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2017 License: AGPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CVE

type CVE string

CVE is a single CVE

type CVEs

type CVEs []CVE

CVEs is a list of CVE instances

func (*CVEs) Append

func (c *CVEs) Append(cves []CVE)

Append appends a list of CVEs to the current CVEs instance

func (*CVEs) AppendSingle

func (c *CVEs) AppendSingle(cve string)

AppendSingle appends a single CVE to the instance

func (*CVEs) Size

func (c *CVEs) Size() int

Size returns the size of the internal list

type Hash

type Hash struct {
	ID    bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty" description:"Internally used ID for the hash"`
	Hash  string        `bson:"hash" json:"hash" description:"The hash string itself"`
	Files []struct {
		Name string `json:"name"`
		Hash string `json:"hash"`
	} `bson:"files" json:"files" description:"File hashes for the artifact"`
	Name      string `bson:"name" json:"name" description:"Name of the artifact"`
	Cves      CVEs   `bson:"cves" json:"cves,omitempty" description:"All known related CVEs"`
	Submitter string `bson:"submitter" json:"submitter,omitempty" description:"User who submitted the hash"`
}

Hash is a representation of a single hash stored in the databse.

type HashSearchResult

type HashSearchResult struct {
	Hashes []Hash `bson:"hashes" json:"hashes"`
}

HashSearchResult holds a list of hashs found during a search of the databse.

func NewHashSearchResult

func NewHashSearchResult() *HashSearchResult

NewHashSearchResult creates a new HashSearchResult instance.

func (*HashSearchResult) AddHash

func (hsr *HashSearchResult) AddHash(h Hash)

AddHash appens a hash to the Hashes attribute.

type Hashes

type Hashes struct {
	// contains filtered or unexported fields
}

Hashes represents a list of hashes

type MultipleHashRequest

type MultipleHashRequest struct {
	Hashes []SingleHashRequest `binding:"required" json:"hashes" description:"All hashes being requested"`
}

MultipleHashRequest represents multiple hashes being requested over HTTP

type SingleHashRequest

type SingleHashRequest struct {
	Hash string `binding:"required" json:"hash" description:"The hash being requested"`
}

SingleHashRequest represents a single hash request via HTTP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL