files

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseMockSASDownloadFailure bool = false

Functions

func DownloadAndProcessArtifact

func DownloadAndProcessArtifact(ctx *log.Context, downloadDir string, artifact *handlersettings.UnifiedArtifact) (string, error)

func DownloadAndProcessScript

func DownloadAndProcessScript(ctx *log.Context, url, downloadDir string, cfg *handlersettings.HandlerSettings) (string, error)

func GetFileFromPosition

func GetFileFromPosition(path string, position int64) ([]byte, error)

func PostProcessFile

func PostProcessFile(path string) error

postProcessFile determines if path is a script file based on heuristics and makes in-place changes to the file with some post-processing such as BOM and DOS-line endings fixes to make the script POSIX-friendly.

func SaveScriptFile

func SaveScriptFile(filePath string, content string) error

func TailFile

func TailFile(path string, max int64) ([]byte, error)

TailFile returns the last max bytes (or the entire file if the file size is smaller than max) from the file at path. If the file does not exist, it returns a nil slice and no error.

func UrlToFileName

func UrlToFileName(fileURL string) (string, error)

UrlToFileName parses given URL and returns the section after the last slash character of the path segment to be used as a file name. If a value is not found, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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