utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTempFiles

func CleanupTempFiles(dir string) error

CleanupTempFiles Cleanup temporary files

func GetGitignorePatterns

func GetGitignorePatterns() ([]string, error)

GetGitignorePatterns reads and returns the patterns from the .gitignore file. If the file does not exist, it returns an empty pattern list.

func GetSupportedLanguage

func GetSupportedLanguage(path string) string

func GracefulShutdown

func GracefulShutdown(done chan bool, cleanup func())

func IsDefaultIgnored

func IsDefaultIgnored(path string) bool

func IsGitIgnored

func IsGitIgnored(path string, patterns []string) bool

IsGitIgnored checks if a file path matches any of the patterns in .gitignore.

func PromptUser

func PromptUser(path string) (bool, error)

PromptUser Prompt the user to accept or reject the changes

func RetryWithBackoff

func RetryWithBackoff(operation func() error, maxRetries uint64) error

RetryWithBackoff Function to encapsulate the retry logic with backoff

func WriteToTempFile

func WriteToTempFile(relativePath string, code string) (string, error)

WriteToTempFile code to a temporary file (without overwriting the original)

Types

This section is empty.

Jump to

Keyboard shortcuts

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