Documentation
¶
Overview ¶
Package common contains common functions used throughout the cli commands. Functions like display.s, CreateFileWithContent and GetEnvDir
Index ¶
- Variables
- func BuildEnvPath(customPath, name, prefix string) (string, error)
- func CheckEnvForUpdates(envFile string) ([]display.ImageUpdateInfo, error)
- func Confirm(prompt string) (bool, error)
- func CopyDir(src, dst string) error
- func CopyFile(src, dst string) error
- func CreateFileWithContent(filePath, content string) error
- func CreateTmpCopy(dir string) (string, error)
- func DeleteEnvDir(path string) error
- func Export(path, filename string, content []byte) error
- func FindFreePort() (int, error)
- func GenerateExportHeader() string
- func GetContentFromPathOrDefault(filePath, defaultContent string) (string, error)
- func GetLocalIP() (string, error)
- func GetVersion() string
- func IsPortFree(port int) (bool, error)
- func PopulateEnv(ttlPath, endpointURL string, parallel int) error
- func PopulateExample(endpointURL string, parallel int) error
- func PopulateOntologies(baseURL string) error
- func RemoveEnvDir(dir string) error
- func RemoveTmpDir(tmpDir string) error
- func RestoreTmpDir(tmpDir, targetDir string) error
Constants ¶
This section is empty.
Variables ¶
var ErrImageMissing = errors.New("image not found locally")
var Version = "dev"
Functions ¶
func BuildEnvPath ¶
BuildEnvPath constructs the environment directory path
func CheckEnvForUpdates ¶ added in v0.9.0
func CheckEnvForUpdates(envFile string) ([]display.ImageUpdateInfo, error)
func CreateFileWithContent ¶
CreateFileWithContent creates a file with given content
func CreateTmpCopy ¶
CreateTmpCopy creates a backup copy of the environment directory in a temporary location
func DeleteEnvDir ¶
func FindFreePort ¶ added in v0.2.0
func GenerateExportHeader ¶ added in v0.7.0
func GenerateExportHeader() string
GenerateExportHeader returns a standardized header for exported files
func GetContentFromPathOrDefault ¶
GetContentFromPathOrDefault reads content from filePath if provided, otherwise returns defaultContent
func GetLocalIP ¶
func GetVersion ¶ added in v0.7.0
func GetVersion() string
GetVersion returns the version of the CLI
func IsPortFree ¶ added in v0.2.0
func PopulateEnv ¶ added in v0.5.0
PopulateEnv ingests TTL (Turtle) files into an environment by posting them to the gatewey endpoint. It accepts either a single file or a directory path. When given a directory, it recursively walks through all subdirectories and ingests all *.ttl files found, processing them in parallel according to the specified concurrency limit.
Parameters:
- ttlPath: Path to a TTL file or directory containing TTL files
- gatewayURL: Base URL of the EPOS gateway (e.g., "https://gateway.example.com")
- parallel: Maximum number of concurrent file ingestions (use 1 for sequential processing)
Returns an error if any file fails to ingest or if the path is invalid.
func PopulateExample ¶ added in v0.5.0
func PopulateOntologies ¶
PopulateOntologies populates an environment deployed in a dir with the base ontologies for the ingestor
func RemoveEnvDir ¶
RemoveEnvDir deletes the environment directory with logs
func RemoveTmpDir ¶
RemoveTmpDir removes the temporary backup directory with logs
func RestoreTmpDir ¶
RestoreTmpDir restores the environment from temporary backup to target directory
Types ¶
This section is empty.