Documentation ¶
Index ¶
- func ConfigRemote(hostname string, port string)
- func Exist(resourceName string, nodes []Node) bool
- func GetChildrenNodes(prefix string, nodes []Node) []string
- func GetDescendantNodes(prefix string, nodes []Node) []string
- func GetRmPatch(key string, tree Tree, resourceName string) filesystem.Patch
- func GetRmPatchString(key string, tree Tree, resourceName string) string
- func GetRootDir(nodes []Node) (rootDir string, err error)
- func IsDir(resourceName string, nodes []Node) bool
- func ParseCatContent(result string, key string) string
- func ParseLsContent(result string, key string) string
- func ParseLsDirectoryContent(content string, key string) []string
- func PrintCat(result string, key string)
- func PrintCommandMessage(f func())
- func PrintConfigremoteMessage()
- func PrintDarkenpathMessage()
- func PrintDecryptcatMessage()
- func PrintDecryptlsMessage()
- func PrintDecrypttreeMessage()
- func PrintEncryptfsMessage()
- func PrintHelp()
- func PrintHelpMessage()
- func PrintLs(result string, key string)
- func PrintMapInOrder(m map[string]func(), order []string)
- func PrintNode(nodes []Node, node Node, last bool, inlast bool)
- func PrintRemoteCat(resourceName string, key string)
- func PrintRemoteLs(resourceName string, key string)
- func PrintRemoteRm(key string, resourceName string)
- func PrintRemotecatMessage()
- func PrintRemotelsMessage()
- func PrintRemotermMessage()
- func PrintRemotetreeMessage()
- func PrintRmPatch(key string, treeJSON string, resourceName string)
- func PrintRmPatchMessage()
- func PrintTree(treeJSON string, key string)
- func RemoteCat(resourceName string, key string) string
- func RemoteExist(resourceName string, key string) bool
- func RemoteGetRootDir(key string) (rootDir string, err error)
- func RemoteGetTreeJSON() string
- func RemoteIsDir(resourceName string, key string) bool
- func RemoteLs(resourceName string, key string) string
- func RemoteRm(key string, resourceName string) string
- func RemoteTree(key string)
- type Node
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigRemote ¶
Use to config the information about remote ubac listener to avoid specifying in CLi all the time
func GetChildrenNodes ¶
Return all nodes with specific prefix/parent directory (ie prefix == node.Parent) It enables us to retrieve all nodes directly under a specified one (with depth=depth_nodes+1)
func GetDescendantNodes ¶
Return all nodes name under the prefix/parent directory (ie node.Parent begin w/ prefix) It enables us to retrieve all nodes under a specified one
func GetRmPatch ¶
func GetRmPatch(key string, tree Tree, resourceName string) filesystem.Patch
provide the patch to remove a resource on ubac side the patch is a json string with 3 arrays: to_add,to_delete and to_change all the info within structure are encrypted after to be put in patch
func GetRmPatchString ¶
provide the patch (string) to remove a resource on ubac side
func GetRootDir ¶
Return root directory path of nodes list
func ParseCatContent ¶
Parse the cat result received from ubac utility cat only work on file resource not directory, so we don't have to check the resourceType Error must be manage by ubac (if file doesn't exist or if it is a directory) result structure: base64(Encrypt(Content))
func ParseLsContent ¶
Parse the ls result received from ubac utility result structure: resourceType:base64(Encrypt(Content))
func ParseLsDirectoryContent ¶
Parse the directory content retrieve from encrypted fs (w/ ubac for example) First decrypt the whole content Then parse the content as each resources is separated by "\"
func PrintCommandMessage ¶
func PrintCommandMessage(f func())
func PrintDecryptcatMessage ¶
func PrintDecryptcatMessage()
func PrintDecrypttreeMessage ¶
func PrintDecrypttreeMessage()
func PrintEncryptfsMessage ¶
func PrintEncryptfsMessage()
func PrintHelpMessage ¶
func PrintHelpMessage()
func PrintMapInOrder ¶
func PrintNode ¶
(recursive) Print the tree under the Node (except the node itself) Retrieve all node under if it is a directory and print it, nothing if it is a file
func PrintRemoteCat ¶
Print the result of a cat on a remote listening ubac (proxing to encrypted fs)
func PrintRemoteLs ¶
func PrintRemoteRm ¶
func PrintRemotecatMessage ¶
func PrintRemotecatMessage()
func PrintRemotelsMessage ¶
func PrintRemotelsMessage()
func PrintRemotermMessage ¶
func PrintRemotermMessage()
func PrintRemotetreeMessage ¶
func PrintRemotetreeMessage()
func PrintRmPatch ¶
func PrintRmPatchMessage ¶
func PrintRmPatchMessage()
func RemoteCat ¶
Perform cat on a remote listening ubac (proxing to encrypted fs) First craft the request, send it (the request instruct ubac to perform a cat) take the reponse and decrypt it
func RemoteExist ¶
connect with remote FS and check if the resource is inside ask /tree endpoint of remote ubac and search resource within
func RemoteGetRootDir ¶
func RemoteGetTreeJSON ¶
func RemoteGetTreeJSON() string
Retrieve the tree in JSON struct from remote (ubac listener)
func RemoteIsDir ¶
connect with remote FS and check if the resource is a directory ask /tree endpoint of remote ubac and determine if the resource is a directory
func RemoteLs ¶
Perform ls on a remote listening ubac (proxing to encrypted fs) First craft the request, send it (the request instruct ubac to perform a ls) take the reponse and decrypt it
func RemoteRm ¶
Remove a resource on remote encrypted fs. First it retrieve tree from remote Then, it forge the patch to apply and finally send it to remote (to be applied by remote ubac lister)
func RemoteTree ¶
func RemoteTree(key string)
Perform tree on a remote listening ubac (proxing to encrypted fs) First craft the request, send it (the request instruct ubac to perform a tree) take the reponse and decrypt it
Types ¶
type Node ¶
/!\ do not confuse with the Node & Tree struct of ubac package
func CreateNode ¶
Create a node from its name, its type and its parent directory
func GetNodeByName ¶
Get a Node by providing its name, an error is thrown if the Node isn't found
func RemoteGetNodes ¶
Return the Node list of the remote tree
type Tree ¶
type Tree struct { Nodes []Node // contains filtered or unexported fields }
func GetTreeStructFromResourcesMap ¶
Get tree structure from map. Map: key= resource name and value= resource type
func GetTreeStructFromTreeJson ¶
Take the Tree from ubac(JSON string format) as input and return it in a struct with decrypted name that help to work with it