worker

package
v0.0.0-...-bd43069 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CompileTime is when this was compiled
	CompileTime string
	// CompileRev is the git revision hash (sha1)
	CompileRev string
)

Functions

func GetAvailableDevices

func GetAvailableDevices() (shared.DeviceMap, error)

GetAvailableDevices returns all available OpenCL devices with the same ID of hashcat Note: had to roll our own due to how OpenCL was integrated into hashcat. Could not use the hashcat OpenCL apis

func InitRPCChannel

func InitRPCChannel(cfg Config) (*rpcclient.RPCClient, error)

InitRPCChannel returns an RPCClient that communicates to the server for beacons, task payload retrieval, status updates, etc

Types

type Config

type Config struct {
	EngineDebug        bool         `yaml:"engine_debug"`
	AutoCPUAssignment  bool         `yaml:"auto_cpu_assignment"`
	ServerConn         serverConfig `yaml:"server"`
	SaveTaskFilePath   string       `yaml:"save_task_file_path"`
	SaveEngineFilePath string       `yaml:"save_engine_file_path"`
	Hashcat            struct {
		LogPath     string `yaml:"log_path"`
		PotfilePath string `yaml:"potfile_path"`
		SessionPath string `yaml:"session_path"`
		SharedPath  string `yaml:"shared_path"`
	} `yaml:"hashcat"`
	Intervals struct {
		// Beacon interval sets how frequently we beacon to the server with an overview of what we're doing
		Beacon *shared.HumanDuration `yaml:"beacon,omitempty"`
		// JobStatus interval sets how frequently we send job status messages to the server
		JobStatus *shared.HumanDuration `yaml:"job_status,omitempty"`
		// TerminationDelay is the time we wait for hashcat to exit when we are told to exit
		TerminationDelay *shared.HumanDuration `yaml:"termination_delay,omitempty"`
	} `yaml:"intervals,omitempty"`
	GPUPriorityAssignment struct {
		High   *int `yaml:"high,omitempty"`
		Normal *int `yaml:"normal,omitempty"`
		Low    *int `yaml:"low,omitempty"`
	} `yaml:"gpus_priority_limit"`
}

Config describes the worker configuration variables

func (*Config) Validate

func (s *Config) Validate() error

Validate the worker config, set default values if none are present, and return any fatal config errors

type WorkerImpl

type WorkerImpl interface {
	Start() error
	Stop() error
}

WorkerImpl describes the core functionality that the parent and child components must implement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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