Documentation ¶
Index ¶
- func ClearStash(workspaceName string) error
- func CopyFiles(src, dst string) (int64, error)
- func DeleteAllFileChanges(dbpool *pgxpool.Pool, workspaceName string, ...) error
- func DeleteFileChange(dbpool *pgxpool.Pool, workspaceChangesKey, workspaceName, fileName, oid string) error
- func GetContent(workspaceName, fileName string) (string, error)
- func RestaureFiles(srcDir, dstDir string) error
- func RunCommand(buf *strings.Builder, command string, args *[]string, workspaceName string) error
- func SaveClientConfig(dbpool *pgxpool.Pool, workspaceName, clientName string) error
- func SaveContent(dbpool *pgxpool.Pool, workspaceName, fileName, fileContent string) error
- func StashDir() string
- func StashFiles(workspaceName string) error
- type WorkspaceNode
- type WorkspaceStructure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAllFileChanges ¶
func DeleteAllFileChanges(dbpool *pgxpool.Pool, workspaceName string, restaureFromStash, keepWorkspaceAndLookupDb bool) error
Delete all files overrides from database for workspaceName. if restaureFromStash is true then, replace the local file with the stash content if keepWorkspaceAndLookupDb is true, then don't remove files 'workspace.db', 'lookup.db', 'workspace.tgz', 'reports.tgz' from the overrides
func DeleteFileChange ¶
func DeleteFileChange(dbpool *pgxpool.Pool, workspaceChangesKey, workspaceName, fileName, oid string) error
Function to delete workspace file changes based on rows in workspace_changes Delete the workspace_changes row and the associated large object
func GetContent ¶
GetWorkspaceFileContent -------------------------------------------------------------------------- Function to get the workspace file content based on relative file name Read the file from the workspace on file system since it's already in sync with database
func RestaureFiles ¶
Restaure (copy dir recursively) srcDir to dstDir
func RunCommand ¶
Run command in workspace
func SaveClientConfig ¶
SaveWorkspaceFileContent -------------------------------------------------------------------------- Function to save client config in local workspace file system and in database
func SaveContent ¶
SaveWorkspaceFileContent -------------------------------------------------------------------------- Function to save the workspace file content in local workspace file system and in database
func StashFiles ¶
StashFiles -------------------------------------------------------------------------- Function to copy all workspace files to a stash location The stash is used when deleting workspace changes to restore the file to original content
Types ¶
type WorkspaceNode ¶
type WorkspaceNode struct { Key string `json:"key"` PageMatchKey string `json:"pageMatchKey"` Type string `json:"type"` Size int64 `json:"size"` Label string `json:"label"` RoutePath string `json:"route_path"` RouteParams map[string]string `json:"route_params"` Children *[]*WorkspaceNode `json:"children"` }
func VisitDirWrapper ¶
func VisitDirWrapper(root, dir, dirLabel string, filters *[]string, workspaceName string) (*WorkspaceNode, error)
type WorkspaceStructure ¶
type WorkspaceStructure struct { Key string `json:"key"` WorkspaceName string `json:"workspace_name"` ResultType string `json:"result_type"` ResultData *[]*WorkspaceNode `json:"result_data"` }
This struct correspond to MenuEntry for the ui