package
3.16.1+incompatible
Repository: https://github.com/redhat-developer/odo.git
Documentation: pkg.go.dev
# Functions
AddOdoFileIndex adds odo-file-index.json to .gitignore.
CalculateFileDataKeyFromPath converts an absolute path to relative (and converts to OS-specific paths) for use as a map key in IndexerRet and FileIndex.
CaseInsensitive returns a function which compares two words caseinsensitively.
CheckPathExists checks if a path exists or not TODO(feloy) use from devfile library?.
CleanDefaultHTTPCacheDir cleans the default directory used for HTTP caching.
ConvertLabelsToSelector converts the given labels to selector To pass operands such as !=, append a ! prefix to the value.
CopyDirWithFS copies a whole directory recursively.
CreateIfNotExists creates the directory and the file if it doesn't exist.
DeleteConfiguration sets a parameter to null in a struct using reflection.
DeleteIndexFile deletes the index file.
DisplayLog displays logs to user stdout with some color formatting numberOfLastLines limits the number of lines from the output when we are not following it TODO(feloy) sync with devfile library?.
DownloadFileInMemory uses the url to download the file and return bytes TODO(feloy): sync with devfile library?.
DownloadFileInMemoryWithCache uses the url to download the file and return bytes.
GenerateNewFileDataEntry creates a new FileData entry for use by IndexerRet and/or FileIndex.
GetAndExtractZip downloads a zip file from a URL with a http prefix or takes an absolute path prefixed with file:// and extracts it to a destination.
Bool returns pointer to passed boolean.
GetCommandStringFromEnvs creates a string from the given environment variables.
GetDataFromURI gets the data from the given URI if the uri is a local path, we use the componentContext to complete the local path.
GetDNS1123Name Converts passed string into DNS-1123 string TODO(feloy) sync with devfile library?.
GetFromFile unmarshals a struct from a odo config file.
GetGitOriginPath gets the remote fetch URL from the given git repo if the repo is not a git repo, the error is ignored.
GetIndexFileRelativeToContext returns the index file relative to context i.e.; .odo/odo-file-index.json.
GetLowerCaseParameters creates a set-like map of supported parameters from the supported parameter names.
GitSubDir handles subDir for git components using the default filesystem.
IsPortFree checks if the port on a given address is free to use.
IsSet uses reflection to check if a parameter is set in a struct using the name in a case insensitive manner only supports flat structs TODO: support deeper struct using recursion.
IsValidProjectDir checks that the folder to download the project from devfile is either empty or contains the devfile used.
NamespaceKubernetesObject hyphenates applicationName and componentName.
NamespaceKubernetesObjectWithTrim hyphenates applicationName and componentName if the resultant name is greater than 63 characters it trims app name then component name.
NewConcurrentTasks creates a new ConcurrentTasks instance, dimensioned to accept at least the specified number of tasks.
NewFileIndex returns a fileIndex.
NextFreePort returns the next free port on system, starting at start end finishing at end.
ReadFileIndex tries to read the odo index file from the given location and returns the data from the file if no such file is present, it means the folder hasn't been walked and thus returns an empty list.
ResolveIndexFilePath resolves the filepath of the odo index file in the .odo folder.
RunIndexerWithRemote reads the existing index from the given directory and runs the indexer on it with the given ignore rules it also adds the file index to the .gitignore file and resolves the path.
SafeGetBool returns the value of the bool pointer, or false if the pointer is nil.
StartSignalWatcher watches for signals and handles the situation before exiting the program.
TouchGitIgnoreFile checks .gitignore file exists or not, if not then creates it.
TruncateString truncates passed string to given length Note: if -1 is passed, the original string is returned if appendIfTrunicated is given, then it will be appended to trunicated string TODO(feloy) sync with devfile library?.
Unzip will decompress a zip archive, moving specified files and folders within the zip file (parameter 1) to an output directory (parameter 2) Source: https://golangcode.com/unzip-files-in-go/ pathToUnzip (parameter 3) is the path within the zip folder to extract TODO(feloy) sync with devfile library?.
ValidateURL validates the URL TODO(feloy) sync with devfile library?.
WriteFile writes a file map to a file, the file map is given by newFileMap param and the file location is resolvedPath param.
WriteToJSONFile writes a struct to json file.
WriteToYAMLFile marshals a struct to a file.
# Constants
No description provided by the author
No description provided by the author
# Structs
ConcurrentTask is a task to execute in a go-routine.
ConcurrentTasks records tasks to be run concurrently with go-routines.
No description provided by the author
FileIndex holds the file index used for storing local file state change.
IndexerRet is a struct that represent return value of RunIndexer function.