Documentation
¶
Index ¶
- Constants
- func AzdConfigDir() (string, error)
- func ComputeChecksum(filePath string) (string, error)
- func CopyFile(source, target string) error
- func CreateLocalRegistry() error
- func DefaultArtifactPatterns(extensionId, version string) ([]string, error)
- func DownloadAssetToTemp(assetUrl, assetName string) (string, error)
- func FindArtifacts(patterns []string, extensionId, version string) ([]string, error)
- func GetFileNameWithoutExt(filePath string) string
- func HasLocalRegistry() (bool, error)
- func InferOSArch(filename string) (string, error)
- func LocalRegistryArtifactsPath() (string, error)
- func TarGzSource(files []string, target string) error
- func ToPascalCase(value string) string
- func ToPtr[T any](value T) *T
- func WriteCommandHeader(header string, description string)
- func WriteCommandSuccess(message string)
- func ZipSource(files []string, target string) error
- type UserFriendlyError
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func AzdConfigDir ¶
func ComputeChecksum ¶
ComputeChecksum computes the SHA256 checksum of a file
func CopyFile ¶
CopyFile copies a file from source to destination. On Windows, if the target file is locked (e.g., by a running process), it attempts to rename the locked file out of the way before copying.
func CreateLocalRegistry ¶
func CreateLocalRegistry() error
CreateLocalRegistry creates a local extension source registry
func DefaultArtifactPatterns ¶
DefaultArtifactPatterns returns the default glob patterns for finding extension artifacts in the local registry.
func DownloadAssetToTemp ¶
DownloadAssetToTemp downloads an asset (from URL or local path) to a temp file and returns the file path.
func FindArtifacts ¶
FindArtifacts finds all artifact files for an extension using the provided patterns or defaults.
func GetFileNameWithoutExt ¶
GetFileNameWithoutExt extracts the filename without its extension
func HasLocalRegistry ¶
HasLocalRegistry checks if a local extension source registry exists
func InferOSArch ¶
InferOSArch infers OS/ARCH from a artifact filename
func TarGzSource ¶
func ToPascalCase ¶
func WriteCommandHeader ¶
func WriteCommandSuccess ¶
func WriteCommandSuccess(message string)
Types ¶
type UserFriendlyError ¶
type UserFriendlyError struct {
// Technical error message that will be shown as an error
ErrorMessage string
// User-friendly additional details or instructions that should be shown in normal text
UserDetails string
}
UserFriendlyError represents an error with additional user-friendly details. This error type is designed to separate technical error messages (which may be displayed in red) from instructional content (which should be displayed in normal text).
func NewUserFriendlyError ¶
func NewUserFriendlyError(errorMessage, userDetails string) *UserFriendlyError
NewUserFriendlyError creates a new UserFriendlyError with the given error message and user details
func NewUserFriendlyErrorf ¶
func NewUserFriendlyErrorf(errorMessage string, userDetails string, args ...any) *UserFriendlyError
NewUserFriendlyErrorf creates a new UserFriendlyError with a formatted error message and user details
func (*UserFriendlyError) Error ¶
func (e *UserFriendlyError) Error() string
Error returns the technical error message, implementing the error interface
func (*UserFriendlyError) GetUserDetails ¶
func (e *UserFriendlyError) GetUserDetails() string
GetUserDetails returns the user-friendly additional details