ciutil

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: AGPL-3.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndCreateDirectory

func CheckAndCreateDirectory(path string, mode os.FileMode) error

CheckAndCreateDirectory checks if the directory exists in path . Creates if it does not exist

func Copy added in v0.2.4

func Copy(src io.ReadCloser, w io.Writer) error

Copy copies the data from readCloser to the writer

func OnCreateNewFile

func OnCreateNewFile(localFile string, fnOnCreate OnWriterFunc) error

OnCreateNewFile creates a new file and performs an operation on the same

func OnReadClose added in v0.2.3

func OnReadClose(reader io.ReadCloser, fnOnReadClose OnReadCloseFunc) error

OnReadClose closes a given reader in that function

func OnReadEntireFile

func OnReadEntireFile(localFile string, fnOnBytes OnBytesFunc) error

OnReadEntireFile reads the entire file and processes the same

func OnTempDirectory

func OnTempDirectory(dir string, prefix string, fnOnDir OnDirFunc) (string, error)

OnTempDirectory creates a temp directory and provides the same for using it

func WriteString added in v0.2.1

func WriteString(writer io.Writer, s string) error

WriteString writes a given string

func WriteStringln added in v0.2.1

func WriteStringln(writer io.Writer, s string) error

WriteStringln writes a given string with new line

func WriteStrings added in v0.2.1

func WriteStrings(writer io.Writer, s []string) error

WriteStrings writes an array of strings separated by newline

func WriteTarFile added in v0.2.6

func WriteTarFile(inputDirectory string, w io.Writer) error

WriteTarFile writes the given inputDirectory to the underlying tar writer

Types

type OnBytesFunc added in v0.2.2

type OnBytesFunc func(b []byte) error

OnBytesFunc represents a function to act on the bytes

type OnDirFunc added in v0.2.2

type OnDirFunc func(inDir string) error

OnDirFunc represents a function to act on a given directory

type OnReadCloseFunc added in v0.2.3

type OnReadCloseFunc func(reader io.ReadCloser) error

OnReadCloseFunc represents a func to act on a given io.ReadCloser instance and closes the same

type OnWriterFunc added in v0.2.2

type OnWriterFunc func(w io.Writer) error

OnWriterFunc represents a function to act on a writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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