common

package module
v0.0.0-...-e258396 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Overview

Package common defines the constants used by the project

Index

Constants

View Source
const (
	// TEXTDOMAIN is the gettext domain for l10n.
	TEXTDOMAIN = `ubuntu-pro`

	// LocalAppDataDir is the relative path name used to store data private to the Appx.
	//  ${env:LocalAppData}/{LocalAppDataDir}
	LocalAppDataDir = "Ubuntu Pro"

	// UserProfileDir is the relative path name used to store data that needs to be shared between components.
	//  ${env:UserProfile}/{UserProfileDir}
	UserProfileDir = ".ubuntupro"

	// ListeningPortFileName corresponds to the base name of the file hosting the addressing of our GRPC server.
	ListeningPortFileName = ".address"

	// MsStoreProductID is the ID of the product in the Microsoft Store
	//
	// TODO: Replace with real product ID.
	MsStoreProductID = "9P25B50XMKXT"

	// CertificatesDir is the agent's public subdirectory where the certificates are stored.
	CertificatesDir = "certs"

	// GRPCServerNameOverride is the name to override the server name in when configuring TLS for local clients.
	GRPCServerNameOverride = "UP4W"

	// RootCACertFileName is the name of the certificate file that identifies the root certificate authority in the PEM format.
	RootCACertFileName = "ca_cert.pem"

	// AgentCertFilePrefix is the file name prefix to identify the certificate/key pair of the agent in the PEM format.
	AgentCertFilePrefix = "agent"

	// ClientsCertFilePrefix is the file name prefix to identify the certificate/key pair of the clients (GUI and all WSL instances) in the PEM format.
	ClientsCertFilePrefix = "client"

	// CertificateSuffix is the file name suffix to the (public) certificate in the PEM format.
	CertificateSuffix = "_cert.pem"

	// KeySuffix is the file name suffix to the private key in the PEM format.
	KeySuffix = "_key.pem"
)

Variables

This section is empty.

Functions

func Obfuscate

func Obfuscate(contents string) string

Obfuscate returns a partially hidden version of the contents, suitable for logging low-sensitive information. Hidden enough to prevent others from reading the value while still allowing the contents author to recognize it. Useful for reading logs with test data. For example: `Obfuscate("Blahkilull")=="Bl******ll`".

func WSLLauncher

func WSLLauncher(distroName string) (string, error)

WSLLauncher translates the name of an Ubuntu WSL distro into the base path for its launcher.

Types

This section is empty.

Directories

Path Synopsis
Package certs provides functions to create certificates suitable for mTLS communication.
Package certs provides functions to create certificates suitable for mTLS communication.
grpc
contextidler
Package contextidler allows to timeout any idled client connection.
Package contextidler allows to timeout any idled client connection.
grpcerror
Package grpcerror formats well known GRPC errors to comprehensible end-user errors.
Package grpcerror formats well known GRPC errors to comprehensible end-user errors.
interceptorschain
Package interceptorschain allows chaining multiple streams server interceptor by returning an unique interceptor.
Package interceptorschain allows chaining multiple streams server interceptor by returning an unique interceptor.
logconnections
Package logconnections implements a stream interceptor to notify the pinged object on each new and ended connections.
Package logconnections implements a stream interceptor to notify the pinged object on each new and ended connections.
logstreamer
Package log implements multiple string interceptors to stream logs initiated and tagged from the server to the targeted clients.
Package log implements multiple string interceptors to stream logs initiated and tagged from the server to the targeted clients.
logstreamer/test
Package test contains the log test generated struct for logstreamer package tests.
Package test contains the log test generated struct for logstreamer package tests.
Package i18n is responsible for internationalization/translation handling and generation.
Package i18n is responsible for internationalization/translation handling and generation.
Package testdetection helps in deciding if we are currently running under tests.
Package testdetection helps in deciding if we are currently running under tests.
Package testutils implements helper functions for frequently needed functionality in tests.
Package testutils implements helper functions for frequently needed functionality in tests.
Package wsltestutils implements helper functions for frequently needed functionality in Windows-Agent and End-to-End tests.
Package wsltestutils implements helper functions for frequently needed functionality in Windows-Agent and End-to-End tests.

Jump to

Keyboard shortcuts

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