network

package
v0.0.0-...-6bb147f Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpClient = NewHTTPClient(time.Second * 3)

Construct a http.Client with a 3 second timeout for use in API requests

Functions

func GenerateAPIAddress

func GenerateAPIAddress(address string, port int) string

Plug the Pi-Hole address and port together to get a full URL

func IsAlive

func IsAlive(address string) bool

IsAlive will, given an IP and port, return true or false denoting if the address is alive

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *http.Client

Create a new http.Client with a given timeout duration

func ValidatePiHoleDetails

func ValidatePiHoleDetails(res *http.Response) bool

Do the provided address & port actually point to a live Pi-Hole? Issue #16 @https://github.com/Reeceeboii/Pi-CLI/issues/16

Types

This section is empty.

Jump to

Keyboard shortcuts

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