util

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Timezones = []string{}/* 575 elements not displayed */

Functions

func ConvertToBytes

func ConvertToBytes(input string) (int64, error)

func DownloadUnpackTgz added in v0.11.5

func DownloadUnpackTgz(downloadURL string, destDir string) error

func FixListenAddress added in v0.10.0

func FixListenAddress(address string) string

func GenerateCertificate

func GenerateCertificate(dnsNames []string, ipAddresses []net.IP) (string, string, error)

GenerateCertificate generates a self-signed certificate and private key in PEM format.

func GetGitHubKeys added in v0.9.0

func GetGitHubKeys(username string) (string, error)

Download the public keys from GitHub, https://github.com/<username>.keys

func GetGitHubKeysArray added in v0.11.5

func GetGitHubKeysArray(username string) ([]string, error)

func GetLocalIP added in v0.11.0

func GetLocalIP() (string, error)

Get the local IP address of the machine we're running on, interfaces are checked for being up.

func LookupIP added in v0.9.0

func LookupIP(host string) (*[]string, error)

func LookupSRV added in v0.9.0

func LookupSRV(service string) (*[]HostPort, error)

Look up the address of a service via a DNS SRV lookup against either consul servers or nameservers

func NewCopier

func NewCopier(socket net.Conn, wsConnection *websocket.Conn) *copierConnections

func PrintTable added in v0.9.0

func PrintTable(table [][]string)

func RedirectToSyslog added in v0.11.5

func RedirectToSyslog(cmd *exec.Cmd)

func ResolveSRVHttp

func ResolveSRVHttp(uri string) string

func UpdateAuthorizedKeys

func UpdateAuthorizedKeys(key string, githubUsername string) error

func UpdateSSHConfig added in v0.9.0

func UpdateSSHConfig(sshConfig string) error

func UpgradeToWS

func UpgradeToWS(w http.ResponseWriter, r *http.Request) *websocket.Conn

Upgrade the connection to a websocket connection

Types

type HostPort added in v0.9.0

type HostPort struct {
	Host string
	Port string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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