dirlist

package module
v0.0.0-...-be89b69 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 3 Imported by: 0

README

DirList Go Reference

DirList allows you to quickly spin up an HTTP server to view and browse directory listing of any of your folders, and browse them on your browser.

Installing

go install github.com/ayushg3112/dirlist/cmd/dirlist@latest

Usages

View Help
$ dirlist --help 
Usage: 
  -c, --cached              Run in cached mode. Cached mode generates the structure once and always shows that even if the underlying structure has changed
  -h, --help                View help
  -p, --port int            Port on which to start the listing server (default 8000)
  -d, --root-dir string     Root directory to start directory listing. Defaults to $PWD (default ".")
  -f, --sort-field string   Field to sort by (default "modifiedAt")
      --sort-order string   Sorting order. ASC/DESC. (default "ASC")
Start a Server

To start a server in the current directory with default options:

$ dirlist
2022/09/03 16:13:10 starting the server at port 8000

To start a server in another directory:

$ dirlist --root-dir /path/to/folder --sort-order ASC --sort-field modifiedAt
2022/09/03 16:15:24 starting the server at port 8000
To run locally after cloning
$ go run ./cmd/dirlist/... --root-dir /path/to/folder --sort-order ASC --sort-field modifiedAt
2022/09/03 16:15:24 starting the server at port 8000

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(options ProcessingOptions) error

Types

type ProcessingOptions

type ProcessingOptions struct {
	RootDirAbsPath string
	HTTPPort       string
	SortOrder      sort.Order
	SortField      sort.Field
	CachedMode     bool
}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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