From 0ca678228d4d96963ff696ce753b47db29a5fe35 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 2 May 2015 16:12:19 +0200 Subject: [PATCH] node: add comments --- node.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node.go b/node.go index 39f1da2cb..958fc16e4 100644 --- a/node.go +++ b/node.go @@ -17,6 +17,7 @@ import ( "github.com/restic/restic/server" ) +// Node is a file, directory or other item in a backup. type Node struct { Name string `json:"name"` Type string `json:"type"` @@ -62,6 +63,7 @@ func (node Node) Tree() *Tree { return node.tree } +// NodeFromFileInfo returns a new node from the given path and FileInfo. func NodeFromFileInfo(path string, fi os.FileInfo) (*Node, error) { node := &Node{ path: path, @@ -100,6 +102,7 @@ func nodeTypeFromFileInfo(fi os.FileInfo) string { return "" } +// CreatAt creates the node at the given path and restores all the meta data. func (node *Node) CreateAt(path string, s *server.Server) error { switch node.Type { case "dir":