internal

package
v1.23.13 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionDirectory      os.FileMode = 0755
	PermissionExecutableFile os.FileMode = 0755
	PermissionFile           os.FileMode = 0644

	PermissionDirectoryOwnerOnly os.FileMode = 0700
	PermissionFileOwnerOnly      os.FileMode = 0600

	PermissionMaskDirectoryExecute os.FileMode = 0100
)

Variables

This section is empty.

Functions

func AzdConfigDir

func AzdConfigDir() (string, error)

func ComputeChecksum

func ComputeChecksum(filePath string) (string, error)

ComputeChecksum computes the SHA256 checksum of a file

func CopyFile

func CopyFile(source, target string) error

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

func DefaultArtifactPatterns(extensionId, version string) ([]string, error)

DefaultArtifactPatterns returns the default glob patterns for finding extension artifacts in the local registry.

func DownloadAssetToTemp

func DownloadAssetToTemp(assetUrl, assetName string) (string, error)

DownloadAssetToTemp downloads an asset (from URL or local path) to a temp file and returns the file path.

func FindArtifacts

func FindArtifacts(patterns []string, extensionId, version string) ([]string, error)

FindArtifacts finds all artifact files for an extension using the provided patterns or defaults.

func GetFileNameWithoutExt

func GetFileNameWithoutExt(filePath string) string

GetFileNameWithoutExt extracts the filename without its extension

func HasLocalRegistry

func HasLocalRegistry() (bool, error)

HasLocalRegistry checks if a local extension source registry exists

func InferOSArch

func InferOSArch(filename string) (string, error)

InferOSArch infers OS/ARCH from a artifact filename

func LocalRegistryArtifactsPath

func LocalRegistryArtifactsPath() (string, error)

func TarGzSource

func TarGzSource(files []string, target string) error

func ToPascalCase

func ToPascalCase(value string) string

func ToPtr

func ToPtr[T any](value T) *T

func WriteCommandHeader

func WriteCommandHeader(header string, description string)

func WriteCommandSuccess

func WriteCommandSuccess(message string)

func ZipSource

func ZipSource(files []string, target string) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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