Documentation ¶
Index ¶
- Variables
- func GetDevicesInUse(d shared.DeviceMap) storage.CLDevices
- func WrapCallError(f RPCAPI) gin.HandlerFunc
- type BeaconPayloadType
- type BeaconRequest
- type BeaconResponse
- type ChangeTaskStatus
- type ChangeTaskStatusRequest
- type Config
- type CrackedPasswordRequest
- type FileType
- type GoCrackRPC
- type NewTask
- type NewTaskPayloadResponse
- type PayloadItem
- type RPCAPI
- type RPCError
- type RPCServer
- type RequestTaskPayload
- type TaskCheckpointSaveRequest
- type TaskFileGetRequest
- type TaskStatusUpdate
Constants ¶
This section is empty.
Variables ¶
var ErrNoCheckpoint = errors.New("rpc: no checkpoint file for task")
ErrNoCheckpoint is returned when a checkpoint does not exist for the task
Functions ¶
func GetDevicesInUse ¶
GetDevicesInUse returns a list of CLDevices inuse from a DeviceMap object
func WrapCallError ¶
func WrapCallError(f RPCAPI) gin.HandlerFunc
Types ¶
type BeaconPayloadType ¶
type BeaconPayloadType uint8
BeaconPayloadType describes the type of payload being sent to the worker
const ( // BeaconNewTask indicates the BeaconResponse.Payload is a "NewTask" BeaconNewTask BeaconPayloadType = 1 << iota // BeaconChangeTaskStatus indicates that the payload should be parsed as a task status change BeaconChangeTaskStatus )
type BeaconRequest ¶
BeaconRequest describes the payload sent by the worker to the server
type BeaconResponse ¶
type BeaconResponse struct { Payloads []PayloadItem ServerTime time.Time }
BeaconResponse describes the payload sent to the worker on a beacon
type ChangeTaskStatus ¶
type ChangeTaskStatus struct { TaskID string NewStatus storage.TaskStatus }
ChangeTaskStatus describes the payload sent to the worker
type ChangeTaskStatusRequest ¶
type ChangeTaskStatusRequest struct { TaskID string NewStatus storage.TaskStatus Error *string }
type CrackedPasswordRequest ¶
type GoCrackRPC ¶
type GoCrackRPC interface { Beacon(BeaconRequest) (*BeaconResponse, error) ChangeTaskStatus(ChangeTaskStatusRequest) error GetTask(RequestTaskPayload) (*NewTaskPayloadResponse, error) GetFile(TaskFileGetRequest) (io.ReadCloser, string, error) SavedCrackedPassword(CrackedPasswordRequest) error SendTaskStatus(TaskStatusUpdate) error GetCheckpointFile(string) ([]byte, error) SendCheckpointFile(TaskCheckpointSaveRequest) error }
GoCrackRPC describes all the methods that a worker uses to send updates to the server
type NewTask ¶
type NewTask struct { ID string Engine storage.WorkerCrackEngine Priority storage.WorkerPriority Devices storage.CLDevices }
NewTask describes the payload sent to the worker when a task should be executed
type NewTaskPayloadResponse ¶
type NewTaskPayloadResponse struct { TaskID string FileID string Engine storage.WorkerCrackEngine Priority storage.WorkerPriority EnginePayload json.RawMessage TaskDuration int }
type PayloadItem ¶
type PayloadItem struct { Type BeaconPayloadType Data json.RawMessage }
PayloadItem is an item that contains data for a BeaconResponse where the data is unmarshalled based on it's Type
type RPCServer ¶
func NewRPCServer ¶
func NewRPCServer(cfg Config, stor storage.Backend, wmgr *workmgr.WorkerManager) (*RPCServer, error)
NewRPCServer creates an RPC server that workers connect to
type RequestTaskPayload ¶
type RequestTaskPayload struct {
TaskID string
}
type TaskFileGetRequest ¶
type TaskStatusUpdate ¶
type TaskStatusUpdate struct { Engine storage.WorkerCrackEngine TaskID string Final bool Payload interface{} }