util

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 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

func CheckShells(preferredShell string) string

func ConvertToBytes

func ConvertToBytes(input string) (int64, error)

func CopyFields

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

CopyFields copies specified fields from src to dst using reflection.

func DownloadUnpackTgz

func DownloadUnpackTgz(downloadURL string, destDir string) error

func FixListenAddress

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

func GetGitHubKeys(username string) (string, error)

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

func GetGitHubKeysArray

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

func GetLocalIP

func GetLocalIP() (string, error)

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

func InArray

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

Checks if a string is in a slice of strings.

func NewCopier

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

func PrettyPrintJSON added in v0.19.0

func PrettyPrintJSON(v interface{}) error

func PrintTable

func PrintTable(table [][]string)

func RedirectToSyslog

func RedirectToSyslog(cmd *exec.Cmd)

func UpdateAuthorizedKeys

func UpdateAuthorizedKeys(keys []string, githubUsernames []string) error

func UpdateSSHConfig

func UpdateSSHConfig(sshConfig string, alias string) error

func UpgradeToWS

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

Upgrade the connection to a websocket connection

Types

type SkillFrontmatter added in v0.23.0

type SkillFrontmatter struct {
	Name        string
	Description string
}

func ParseSkillFrontmatter added in v0.23.0

func ParseSkillFrontmatter(content string) (*SkillFrontmatter, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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