storage

package
v0.0.0-...-185ad70 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Output Parameters
	DefaultOutputPath             = "results"
	DefaultFileSubdir             = "files"
	DefaultScriptSubdir           = "scripts"
	DefaultCoverageSubdir         = "coverage"
	DefaultCrawlMetadataFile      = "metadata.json"
	DefaultResourceMetadataFile   = "resource_metadata.json"
	DefaultScriptMetadataFile     = "script_metadata.json"
	DefaultJSTracePath            = "js_trace.json"
	DefaultResourceTreePath       = "resource_tree.json"
	DefaultWebSocketTrafficFile   = "websocket_data.json"
	DefaultBrowserLogFileName     = "browser.log"
	DefaultNetworkStraceFileName  = "network.strace"
	MongoStorageTimeoutSeconds    = 90
	MongoStorageJSBufferLen       = 10000
	MongoStorageResourceBufferLen = 100
	TempDir                       = ".tmp"
	MaxInt64                      = 9223372036854775807
)

Variables

This section is empty.

Functions

func CopyDirRemote

func CopyDirRemote(sftpConn *sftp.Client, localDirname string, remoteDirname string) error

func CreateRemoteConnection

func CreateRemoteConnection(host string) (*t.SSHConn, error)

func StoreResultsLocalFS

func StoreResultsLocalFS(r *t.FinalMIDAResult, outpath string) error

Given a valid FinalMIDAResult, stores it according to the output path specified in the sanitized task within the result

func StoreResultsSSH

func StoreResultsSSH(r *t.FinalMIDAResult, activeConn *t.SSHConn, remotePath string) error

Stores a result directory (via SSH/SFTP) to a remote host, given an already active SSH connection. Ensure that you lock the relevant SSH connection Before calling this.

Types

type MongoConn

type MongoConn struct {
	Ctx    context.Context
	Client *mongo.Client
	Coll   *mongo.Collection
}

func CreateMongoDBConnection

func CreateMongoDBConnection(uri string, collection string) (*MongoConn, error)

func (*MongoConn) ReserveObjIDs

func (conn *MongoConn) ReserveObjIDs(num int64) (start int64, end int64, err error)

Reserves a set of object IDs in the MongoDB database. Start and end are inclusive.

func (*MongoConn) StoreJSTrace

func (conn *MongoConn) StoreJSTrace(r *t.FinalMIDAResult) error

func (*MongoConn) StoreMetadata

func (conn *MongoConn) StoreMetadata(r *t.FinalMIDAResult) (int64, error)

func (*MongoConn) StoreResources

func (conn *MongoConn) StoreResources(r *t.FinalMIDAResult) (*[]int64, error)

func (*MongoConn) StoreWebSocketData

func (conn *MongoConn) StoreWebSocketData(r *t.FinalMIDAResult) (*[]int64, error)

func (*MongoConn) TeardownConnection

func (conn *MongoConn) TeardownConnection() error

Jump to

Keyboard shortcuts

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