ciutil

package module
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: AGPL-3.0 Imports: 7 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 ToSet added in v0.2.9

func ToSet(myList []string) []string

ToSet converts a list of string to a set of string

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 OnGenericFunc added in v0.2.8

type OnGenericFunc func() error

OnGenericFunc represents a function that returns an error or otherwise

type OnProfileFunc added in v0.2.8

type OnProfileFunc func(profile *Profile) error

OnProfileFunc is a function executed on the receipt of a given profile

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

type Profile added in v0.2.8

type Profile struct {
	Name string

	Begin time.Time

	End time.Time

	Duration time.Duration
}

Profile represents the start and end time of a profile

func NewProfile added in v0.2.8

func NewProfile(name string) *Profile

NewProfile creates a new profile

func RunProfile added in v0.2.8

func RunProfile(name string, fnOnGenericFunc OnGenericFunc) (*Profile, error)

RunProfile returns a profile along with the status of the function

func (*Profile) Start added in v0.2.8

func (profile *Profile) Start()

func (*Profile) Stop added in v0.2.8

func (profile *Profile) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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