shred

package module
Version: v0.0.0-...-0347b64 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Unlicense Imports: 3 Imported by: 2

README

GoDoc License Go Report Card

shred

Package shred is a golang library to mimic the functionality of the linux shred command

Usage

package main
import (
  "github.com/lu4p/shred"
)

func main(){
	shredconf := shred.Conf{Times: 1, Zeros: true, Remove: false}
	shredconf.Path("filename")
}

Installation

go get -u github.com/lu4p/shred 

Documentation

Overview

Package shred is a golang library to mimic the functionality of the linux shred command

Example
package main

import (
	"github.com/lu4p/shred"
)

func main() {
	shredconf := shred.Conf{Times: 1, Zeros: true, Remove: false}
	shredconf.Path("/path/to/dir_or_file")
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Times  int
	Zeros  bool
	Remove bool
}

Conf is a object containing all choices of the user

func (Conf) Dir

func (conf Conf) Dir(path string) error

Dir overwrites every File in the location of path and everything in its subdirectories

Example
package main

import (
	"github.com/lu4p/shred"
)

func main() {
	shredconf := shred.Conf{Times: 1, Zeros: true, Remove: false}
	shredconf.Dir("/path/to/dir")
}
Output:

func (Conf) File

func (conf Conf) File(path string) error

File overwrites a given File in the location of path

Example
package main

import (
	"github.com/lu4p/shred"
)

func main() {
	shredconf := shred.Conf{Times: 1, Zeros: true, Remove: false}
	shredconf.File("/path/to/file")
}
Output:

func (Conf) Path

func (conf Conf) Path(path string) error

Path shreds all files in the location of path recursively. If remove is set to true files will be deleted after shredding. When a file is shredded its content is NOT recoverable so USE WITH CAUTION!!!

Example
package main

import (
	"github.com/lu4p/shred"
)

func main() {
	shredconf := shred.Conf{Times: 1, Zeros: true, Remove: false}
	shredconf.Path("/path/to/dir_or_file")
}
Output:

Source Files

Jump to

Keyboard shortcuts

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