util

package
v0.0.0-...-9758eb9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailPretty

func FailPretty(format string, args ...any)

FailPretty prints an error message

func GetAwsConfig

func GetAwsConfig(
	ctx context.Context,
	awsRegion string,
	creds *common.AwsCredentials,
) (*aws.Config, error)

GetAwsConfig builds an aws.Config given some options.

func GetEndToEndEncryptionCertificate

func GetEndToEndEncryptionCertificate(orgID, connectorID string) (*tls.Certificate, error)

func GetFormattedHostname

func GetFormattedHostname() (string, error)

GetFormattedHostname gets a hostname with no special characters.

func GetUserHomeDir

func GetUserHomeDir() (string, error)

GetUserHomeDir returns the home directory of the current user If the process is run as sudo, it will return the home directory of the sudo user ie. the orginal user (not root), based on the SUDO_USER env var

func Hostkey

func Hostkey() (*ssh.Signer, error)

Hostkey returns the ssh signer for the connector host.

func RunningAsAdministrator

func RunningAsAdministrator() bool

RunningAsAdministrator returns true if the runtime has administrative privileges.

func StoreCertificateFiles

func StoreCertificateFiles(key []byte, certficate []byte, path, keyFileName, certificateFileName string) error

func StoreConnectorCertifcate

func StoreConnectorCertifcate(privateKey []byte, certificate []byte, orgID, connectorID string) error

func StoreHostkey

func StoreHostkey(key []byte, path, filename string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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