inquiry

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Port = ":8678"

Functions

func GetName

func GetName() string

GetName returns the ComputerName and/or hostname of the machine

func IsPortAvailable

func IsPortAvailable(port string) bool

IsPortAvailable checks if a port is available by trying to listen on it

func ListenFor

func ListenFor(path string, action func(http.ResponseWriter, *http.Request, string)) (string, error)

func ListenForHash

func ListenForHash() (string, error)

func ListenForToken

func ListenForToken() (string, error)

func Shutdown

func Shutdown(server *http.Server)

func UpdateInquiry

func UpdateInquiry(hash string) error

UpdateInquiry update the inquiry passing ComputerName and user agent

Types

type HashResult

type HashResult struct {
	Hash string `json:"hash"`
}

type Inquiry

type Inquiry struct {
	Hash       string
	Token      string
	Name       string
	IP         string
	Agent      string
	Location   string
	Coordinate string
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

type Response

type Response struct {
	Benchmark float64 `json:"_benchmark"`
	Message   string  `json:"message"`
	Data      Inquiry `json:"data"`
}

Jump to

Keyboard shortcuts

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