util

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CheckShells added in v0.15.1

func CheckShells(preferredShell string) string

func ConvertToBytes

func ConvertToBytes(input string) (int64, error)

func CopyFields added in v0.17.0

func CopyFields(src, dst interface{}, fields []string) error

CopyFields copies specified fields from src to dst using reflection.

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 InArray added in v0.17.0

func InArray(slice []string, item string) bool

Checks if a string is in a slice of strings.

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(keys []string, githubUsernames []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