A utility library to do files/io/bytes processing/parsing in file-system or network.

goreader

A utility library to do files/io/bytes processing/parsing in file-system or network.

  1. These features are really common to be implemented for a non-server/local-running application. Though looking fairly easy, almost all had edge cases to be taken care of minutely.
  2. To use a library package instead of custom segments saves redundant testing/debugging.

Feature list

  • generate parse tree for given paths
    • list out files/folders separately
    • Get hidden files/folders separately
    • Preserve nested order for dir and files
    • Control recursion level
    • Pass custom functions to filter out files and dirs
    • Include StdIn if valid
  • Encodings
    • json to
      • file
      • yaml
    • yaml to
      • json
      • file
    • file to
      • json
      • yaml
  • IO ops
    • copy multi files to single one
    • clone file
    • Pass a callback to be executed over each line of a file
    • bash dirname & basedir function

How to use

use lister

tree := list.Read(&[]string{"."}, 2)
//tree.SkipHiddenDirs = true
e := tree.UpdateFiles()
tree.UpdateStdinStatus()

if e != nil {
    log.Fatal(e)
}
log.Println(tree.IsNestedDir)

use reader

for _,path := range tree.FilePaths{
	if strings.HasSuffix(path,"html") || strings.HasSuffix(path,"htm"){
		err := reader.CloneFile(path, path+".bak")
		if err != nil {
			fmt.Println(err)
			return
		}
		err = reader.CopyContent(path, "envoy/css.ht", path+".bak")
		if err != nil {
			fmt.Println(err)
			return
		}
		err = os.Remove(path+".bak")
		if err != nil {
			fmt.Println(err)
			return
		}
	}
}
Similar Resources

This library provides an ASTERIX Frame(binary data) decoding/parsing(json,xml) capabilities for Go.

GoAsterix This library provides an ASTERIX Frame(binary data) decoding/parsing(json,xml) capabilities for Go. ASTERIX ASTERIX (All Purpose Structured

Dec 13, 2022

Magma: Gives network operators an open, flexible and extendable mobile core network solution

Magma: Gives network operators an open, flexible and extendable mobile core network solution

Connecting the Next Billion People Magma is an open-source software platform tha

Dec 24, 2021

A small utility to extract your Telegram contacts as VCF file.

Telegram to VCF A small utility to extract your Telegram contacts as VCF file. Usage At first build this application or use the precompiled binaries o

Nov 16, 2022

Golang source code parsing, usage like reflect package

gotype Golang source code parsing, usage like reflect package English 简体中文 Usage API Documentation Examples License Pouch is licensed under the MIT Li

Dec 9, 2022

Gene parsing package for Axie Infinity

agp Package agp is a gene parsing package for Axie Infinity. The name agp stands for "Axie Gene Parser" which decodes the hex representation of an Axi

Apr 18, 2022

Go-path - A helper package that provides utilities for parsing and using ipfs paths

go-path is a helper package that provides utilities for parsing and using ipfs paths

Jan 18, 2022

Sentiment Analysis Pipeline + API written in Golang (currently processing Twitter tweets).

Go Sentiment Analysis Components Config: config module based in JSON (enter twitter credentials for use) Controllers: handle the API db call/logic for

Mar 22, 2022

Sentiment Analysis Pipeline + API written in Golang (currently processing Twitter tweets).

Go Sentiment Analysis Components Config: config module based in JSON (enter twitter credentials for use) Controllers: handle the API db call/logic for

Mar 22, 2022

Utilities for processing Wikipedia dumps in Go

Utilities for processing Wikipedia dumps in Go A Go package providing utilities for processing Wikipedia dumps. Features: Supports Wikidata entities J

Nov 29, 2022
Related tags
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Dec 29, 2022
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

kubectl-slice: split Kubernetes YAMLs into files kubectl-slice is a neat tool that allows you to split a single multi-YAML Kubernetes manifest into mu

Jan 3, 2023
Utility to add network config file in apk

Utility to add network config file in apk. Which bypass the proxy intercept restriction for user installed burpsuit CA certificate.

Aug 19, 2022
Print random bytes from a secure source to stdout.

Print random bytes from a secure source to stdout.

Feb 11, 2022
Provides simple, semantic manipulation of the operating system's signal processing.
Provides simple, semantic manipulation of the operating system's signal processing.

Provides simple, semantic manipulation of the operating system's signal processing.

Dec 15, 2021
Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner

Molecule Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner. The API is loosely based on this excellent Go JSON

Jan 5, 2023
A Go (golang) library for parsing and verifying versions and version constraints.

go-version is a library for parsing versions and version constraints, and verifying versions against a set of constraints. go-version can sort a collection of versions properly, handles prerelease/beta versions, can increment versions, etc.

Jan 9, 2023
A library for parsing ANSI encoded strings
 A library for parsing ANSI encoded strings

Go ANSI Parser converts strings with ANSI escape codes into a slice of structs that represent styled text

Sep 20, 2022
A small & fast dependency-free library for parsing micro expressions.

MicroExpr A small & fast dependency-free library for parsing micro expressions. This library was originally built for use in templating languages (e.g

Nov 25, 2022
Simple library to handle ANSI functions and parsing of color formatting strings

Emerald A basic color library for use in my Go projects, built on top of mgutz/ansi. Package ansi is a small, fast library to create ANSI colored stri

Oct 28, 2022