utils

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDistance

func CalculateDistance(p1, p2 Vector2D) float64

CalculateDistance function calculates the distance between two points

func GetBaseURL

func GetBaseURL() string

GetBaseURL function retrieves the base url to be used while redirecting requests

func GetHostname

func GetHostname() string

GetHostname function gets the name of host to be used while obtaining telemetry data

func Hypotenuse

func Hypotenuse(a, b float64) float64

Hypotenuse function returns the hypotenuse of a triangle

func ProcessJSON

func ProcessJSON(data []byte) []byte

ProcessJSON function process the JSON returned by server to a golang readable format

func SetHostname

func SetHostname(newHostname string)

SetHostname function sets the hostname to be used while performing queries

Types

type Vector2D

type Vector2D struct {
	X float64
	Y float64
}

Vector2D is a bidimensional vector

func GetVector2D

func GetVector2D(x, y float64) Vector2D

GetVector2D function returns the 2D vector to the specified coordinates

Jump to

Keyboard shortcuts

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