agent

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

* Copyright (c) 2018 Vladyslav Yamkovyi (Hexawolf), Maks Mazurov (fox.cpp) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE.

Index

Constants

View Source
const AGENT_VERSION = 1

AGENT_VERSION is a super-pooper shared number that is used to identify if we need a agent update

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SupportedTaskTypes []string
	// contains filtered or unexported fields
}

Wrapper class that takes care of all boilerplate required for agent session.

func NewClient

func NewClient(baseURL string) Client

func (*Client) Download

func (c *Client) Download(url string) (io.ReadCloser, error)

func (*Client) PollTasks

func (c *Client) PollTasks() (id int, type_ string, body map[string]interface{}, err error)

PollTasks requests first task from server's queue.

It may block for up to 26 seconds. And also note that it returns error for tasks with type not in SupportedTaskTypes (if SupportTaskTypes is not nil).

This function will return id=-1 if no tasks received.

func (*Client) RegisterAgent

func (c *Client) RegisterAgent(name, hwid string) error

func (*Client) SendTaskResult

func (c *Client) SendTaskResult(taskID int, result map[string]interface{}) error

func (*Client) UploadFile

func (c *Client) UploadFile(src io.Reader) (string, error)

func (*Client) UseAccount

func (c *Client) UseAccount(token string)

Jump to

Keyboard shortcuts

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