wsfile

package
v0.0.0-...-b204547 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearStash

func ClearStash(workspaceName string) error

Function to remove the stash

func CopyFiles

func CopyFiles(src, dst string) (int64, error)

Function to restore file from stash, it copy src file to dst

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', '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

func GetContent(workspaceName, fileName string) (string, error)

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

func RestaureFiles(srcDir, dstDir string) error

Restaure (copy dir recursively) srcDir to dstDir

func RunCommand

func RunCommand(buf *strings.Builder, command string, args *[]string, workspaceName string) error

Run command in workspace

func SaveClientConfig

func SaveClientConfig(dbpool *pgxpool.Pool, workspaceName, clientName string) error

SaveWorkspaceFileContent -------------------------------------------------------------------------- Function to save client config in local workspace file system and in database

func SaveContent

func SaveContent(dbpool *pgxpool.Pool, workspaceName, fileName, fileContent string) error

SaveWorkspaceFileContent -------------------------------------------------------------------------- Function to save the workspace file content in local workspace file system and in database

func StashDir

func StashDir() string

func StashFiles

func StashFiles(workspaceName string) error

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

Jump to

Keyboard shortcuts

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