tree

package module
v0.0.0-...-2cab0f1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2014 License: BSD-2-Clause Imports: 4 Imported by: 0

README

Description of tree

This is a simple applicatons that will print out a directory tree in a graphically manner. It is modeled after the linux tree command. On my mac tree does not come with it so I created a simple replacement in Perl for it. However, recently when I upgrade, the Perl verison stop working because of missing dependeces and I thought I rewrite in Go, to give Go a go. So, far is just does the basics but I would love to hear how I could imporve it and/or code.

baby-gopher

License

Copyright (c) 2014, Gautam Dey All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Documentation

Overview

Pacakge tree implements the methods that are used by the implementation of the tree command. This command display a text based graphical representation of a directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileEntry

type FileEntry struct {

	// the directory entries.
	Error error // The error retrieving this file entry.
	// contains filtered or unexported fields
}

This is a FileEntry that will contain all the information. If the parent is Null then it is root directory entry

func FileEntryValueFrom

func FileEntryValueFrom(i *list.Element) (*FileEntry, error)

func GetFileEntryForDir

func GetFileEntryForDir(name string) *FileEntry

GetFileEntryForDir This is a convience function that just calls GetFileEntryForDirWithThreadSize, with the threadSize set to 200.

func GetFileEntryForDirWithThreadSize

func GetFileEntryForDirWithThreadSize(name string, threadSize int) *FileEntry

GetFileEntryForDirWithThreadSize function returns a FileEntry structure that contains the entire directory tree.

func New

func New(name string) *FileEntry

Create a new file Entry, it will also the initialize the parent dir pointer to nil

func (*FileEntry) AddEntry

func (fe *FileEntry) AddEntry(newEntry *FileEntry) *FileEntry

func (*FileEntry) AllPaths

func (fe *FileEntry) AllPaths() []*FileEntry

func (*FileEntry) Back

func (fe *FileEntry) Back() *list.Element

func (*FileEntry) Filename

func (fe *FileEntry) Filename() string

Return the filename

func (*FileEntry) Front

func (fe *FileEntry) Front() *list.Element

func (*FileEntry) FullFilename

func (fe *FileEntry) FullFilename() string

Return the full filename including the parent directories.

func (*FileEntry) Init

func (fe *FileEntry) Init(name string, parent *FileEntry) *FileEntry

func (*FileEntry) Len

func (fe *FileEntry) Len() int

func (*FileEntry) ParentDir

func (fe *FileEntry) ParentDir() *FileEntry

func (*FileEntry) RemoveElement

func (fe *FileEntry) RemoveElement(e *list.Element) *FileEntry

type FileEntryElementTypeError

type FileEntryElementTypeError string

func (FileEntryElementTypeError) Error

func (err FileEntryElementTypeError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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