Documentation
¶
Index ¶
- func AskConfirmation(message string) bool
- func GetActiveMachineID(proxyURL string) string
- func GetHTBToken() string
- func GetMachineType(machine_id interface{}, proxyURL string) string
- func GetUserSubscription(proxyURL string) string
- func HtbRequest(method string, urlParam string, proxyURL string, jsonData []byte) (*http.Response, error)
- func ParseAndFormatDate(input string) (string, error)
- func ParseJsonMessage(resp *http.Response, key string) interface{}
- func SearchItemIDByName(item string, proxyURL string, element_type string) (string, error)
- func SetOutputTest() (*os.File, *os.File)
- func SetRetiredStatus(data map[string]interface{}) string
- func SetStatus(data map[string]interface{}) string
- func SetTabWriterData(w *tabwriter.Writer, data string)
- func SetTabWriterHeader(header string) *tabwriter.Writer
- type Challenge
- type Machine
- type Root
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskConfirmation ¶ added in v1.2.0
AskConfirmation will request confirmation from the user
func GetActiveMachineID ¶
GetActiveMachineID returns the id of the active machine
func GetHTBToken ¶
func GetHTBToken() string
GetHTBToken checks whether the HTB_TOKEN environment variable exists
func GetMachineType ¶
GetMachineType will return the machine type
func GetUserSubscription ¶
GetUserSubscription returns the user's subscription level
func HtbRequest ¶
func HtbRequest(method string, urlParam string, proxyURL string, jsonData []byte) (*http.Response, error)
HtbRequest makes an HTTP request to the Hackthebox API
func ParseAndFormatDate ¶ added in v1.2.0
ParseAndFormatDate takes an input date string, parses it into a time.Time object, and formats it to the "2006-01-02" format.
func ParseJsonMessage ¶
ParseJsonMessage will parse the result of the API request into a JSON
func SearchItemIDByName ¶ added in v1.1.0
SearchItemIDByName will return the id of an item (machine / challenge) based on its name
func SetOutputTest ¶ added in v1.2.0
Function that removes the output from the console for unit tests. TODO: Move into a utils-tests.go file
func SetRetiredStatus ¶ added in v1.2.0
SetRetiredStatus determines whether an item is retired or not.
func SetTabWriterData ¶ added in v1.2.0
SetTabWriterData will write the contents of each array cell
func SetTabWriterHeader ¶ added in v1.2.0
SetTabWriterHeader will display the information in an array