file

package
v0.0.0-...-3ce79b3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions

func Actions(c echo.Context) error

Actions over a file. Rescan or Download.

func DeleteComment

func DeleteComment(c echo.Context) error

DeleteComment deletes a comment.

func DeleteFile

func DeleteFile(c echo.Context) error

DeleteFile deletes a specific file

func DeleteFiles

func DeleteFiles(c echo.Context) error

DeleteFiles delete all files

func Download

func Download(c echo.Context) error

Download downloads a file.

func DumpRequest

func DumpRequest(req *http.Request)

DumpRequest dumps the headers.

func GetFile

func GetFile(c echo.Context) error

GetFile returns file informations.

func GetFiles

func GetFiles(c echo.Context) error

GetFiles returns list of files.

func PostComment

func PostComment(c echo.Context) error

PostComment creates a new comment.

func PostFiles

func PostFiles(c echo.Context) error

PostFiles creates a new file

func PutFile

func PutFile(c echo.Context) error

PutFile updates a specific file

func PutFiles

func PutFiles(c echo.Context) error

PutFiles bulk updates of files

func ScanFileFromObjectStorage

func ScanFileFromObjectStorage(c echo.Context) error

ScanFileFromObjectStorage scans which was pushed to object storage directly.

Types

type AV

type AV struct {
	Vendor string `json:"vendor,omitempty"`
}

AV vendor

type Comment

type Comment struct {
	Timestamp *time.Time `json:"timestamp,omitempty"`
	Username  string     `json:"username,omitempty"`
	Body      string     `json:"body,omitempty"`
	ID        string     `json:"id,omitempty"`
}

type File

type File struct {
	Md5             string                 `json:"md5,omitempty"`
	Sha1            string                 `json:"sha1,omitempty"`
	Sha256          string                 `json:"sha256,omitempty"`
	Sha512          string                 `json:"sha512,omitempty"`
	Ssdeep          string                 `json:"ssdeep,omitempty"`
	Crc32           string                 `json:"crc32,omitempty"`
	Magic           string                 `json:"magic,omitempty"`
	Size            int64                  `json:"size,omitempty"`
	Exif            map[string]string      `json:"exif,omitempty"`
	TriD            []string               `json:"trid,omitempty"`
	Tags            map[string]interface{} `json:"tags,omitempty"`
	Packer          []string               `json:"packer,omitempty"`
	FirstSubmission *time.Time             `json:"first_submission,omitempty"`
	LastSubmission  *time.Time             `json:"last_submission,omitempty"`
	LastScanned     *time.Time             `json:"last_scanned,omitempty"`
	Submissions     []submission           `json:"submissions,omitempty"`
	Strings         []stringStruct         `json:"strings,omitempty"`
	MultiAV         map[string]interface{} `json:"multiav,omitempty"`
	Status          int                    `json:"status,omitempty"`
	Comments        []Comment              `json:"comments,omitempty"`
	PE              *peparser.File         `json:"pe,omitempty"`
	Histogram       []int                  `json:"histogram,omitempty"`
	ByteEntropy     []int                  `json:"byte_entropy,omitempty"`
	Type            string                 `json:"type,omitempty"`
}

File represent a sample

func GetAllFiles

func GetAllFiles(fields []string) ([]File, error)

GetAllFiles return all files (optional: selecting fields)

func GetFileByFields

func GetFileByFields(fields []string, sha256 string) (File, error)

GetFileByFields return user by username(optional: selecting fields)

func GetFileBySHA256

func GetFileBySHA256(sha256 string) (File, error)

GetFileBySHA256 return user document

func (*File) Save

func (file *File) Save() error

Save creates a new file

type Response

type Response struct {
	Sha256      string `json:"sha256,omitempty"`
	Message     string `json:"message,omitempty"`
	Description string `json:"description,omitempty"`
	Filename    string `json:"filename,omitempty"`
}

Response JSON

Jump to

Keyboard shortcuts

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