persist

package
v0.3.28 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2018 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileInfo

func GetFileInfo(docker *client.Docker, arg string, search string) (string, error)

GetFileInfo start malice/fileinfo container and extract certain fields with a search string

func GetMimeType

func GetMimeType(docker *client.Docker, arg string) (string, error)

GetMimeType returns file's mime type

Types

type File

type File struct {
	Name string `json:"name,omitempty" structs:"name"`
	Path string `json:"path,omitempty" structs:"path"`
	// Valid bool   `json:"valid"`
	Size string `json:"size,omitempty" structs:"size"`
	// CRC32  string
	MD5    string `json:"md5,omitempty" structs:"md5"`
	SHA1   string `json:"sha1,omitempty" structs:"sha1"`
	SHA256 string `json:"sha256,omitempty" structs:"sha256"`
	SHA512 string `json:"sha512,omitempty" structs:"sha512"`
}

File is a file object

func (*File) CopyToSamples

func (file *File) CopyToSamples() error

CopyToSamples copys input file to samples folder

func (*File) GetMD5

func (file *File) GetMD5(data []byte) (hMd5Sum string, err error)

GetMD5 calculates the Files md5sum

func (*File) GetName

func (file *File) GetName() (name string, err error)

GetName returns file name

func (*File) GetSHA1

func (file *File) GetSHA1(data []byte) (h1Sum string, err error)

GetSHA1 calculates the Files sha256sum

func (*File) GetSHA256

func (file *File) GetSHA256(data []byte) (h256Sum string, err error)

GetSHA256 calculates the Files sha256sum

func (*File) GetSHA512

func (file *File) GetSHA512(data []byte) (h512Sum string, err error)

GetSHA512 calculates the Files sha256sum

func (*File) GetSize

func (file *File) GetSize() (bytes int64, err error)

GetSize calculates file Size

func (*File) Init

func (file *File) Init()

Init initializes the File object

func (*File) PrintFileDetails

func (file *File) PrintFileDetails()

PrintFileDetails prints file details

func (*File) ToJSON

func (file *File) ToJSON() []byte

ToJSON converts File object to []byte JSON

func (*File) ToMarkdownTable

func (file *File) ToMarkdownTable()

ToMarkdownTable converts File object Markdown table

type Filestore

type Filestore struct {
	Path             string
	CaCertPath       string
	CaPrivateKeyPath string
}

func NewFilestore

func NewFilestore(path, caCertPath, caPrivateKeyPath string) *Filestore

func (Filestore) Exists

func (s Filestore) Exists(name string) (bool, error)

func (Filestore) GetMachinesDir

func (s Filestore) GetMachinesDir() string

func (Filestore) List

func (s Filestore) List() ([]string, error)

func (Filestore) Load

func (s Filestore) Load(name string) (*host.Host, error)

func (Filestore) Remove

func (s Filestore) Remove(name string) error

func (Filestore) Save

func (s Filestore) Save(host *host.Host) error

Jump to

Keyboard shortcuts

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