package
3.0.0-rc.3+incompatible
Repository: https://github.com/drillbits/iris.git
Documentation: pkg.go.dev

# README

Package information

This package contains helpful functions that iris, internally, uses

That's it.

# Functions

BytesToString accepts bytes and returns their string presentation instead of string() this method doesn't generate memory allocations, BUT it is not safe to use anywhere because it points this helps on 0 memory allocations.
Command executes a command in shell and returns it's output, it's block version.
CommandBuilder creates a Cmd object and returns it accepts 2 parameters, one is optionally first parameter is the command (string) second variatic parameter is the argument(s) (slice of string) the difference from the normal Command function is that you can re-use this Cmd, it doesn't execute until you call its Command function.
CopyDir recursively copies a directory tree, attempting to preserve permissions.
CopyFile copy a file, accepts full path of the source and full path of destination, if file exists it's overrides it this function doesn't checks for permissions and all that, it returns an error if didn't worked.
Deserialize accepts an encoded string and a data struct which will be filled with the desierialized string using gob decoder.
DeserializeBytes converts the bytes to an object using gob decoder.
DirectoryExists returns true if a directory(or file) exists, otherwise false.
DownloadZip downloads a zip file returns the downloaded filename and an error.
Exists returns true if directory||file exists.
FindLower returns the smaller number between a and b.
GetParentDir returns the parent directory(string) of the passed targetDirectory (string).
HTMLEscape returns a string which has no valid html code.
Install is just the flow of: downloadZip -> unzip -> removeFile(zippedFile) accepts 2 parameters first parameter is the remote url file zip second parameter is the target directory returns a string(installedDirectory) and an error (string) installedDirectory is the directory which the zip file had, this is the real installation path, you don't need to know what it's because these things maybe change to the future let's keep it to return the correct path.
MustCommand executes a command in shell and returns it's output, it's block version.
NewBufferPool creates a new BufferPool bounded to the given size.
NewTicker returns a new Ticker.
Random takes a parameter (int) and returns random slice of byte ex: var randomstrbytes []byte; randomstrbytes = utils.Random(32).
RandomString accepts a number(10 for example) and returns a random string using simple but fairly safe random algorithm.
RemoveFile removes a file or directory and returns an error, if any.
Serialize serialize any type to gob bytes and after returns its the base64 encoded string.
SerializeBytes serializa bytes using gob encoder and returns them.
StringToBytes accepts string and returns their []byte presentation instead of byte() this method doesn't generate memory allocations, BUT it is not safe to use anywhere because it points this helps on 0 memory allocations.
TypeByExtension returns the MIME type associated with the file extension ext.
Unzip extracts a zipped file to the target location it removes the zipped file after successfully completion returns a string with the path of the created folder (if any) and an error (if any).
WatchDirectoryChanges watches a directory and fires the callback with the changed name, receives a logger just to print with red letters any errors, no need for second callback.

# Constants

ContentBINARY is the string of "application/octet-stream response headers.

# Variables

AssetsDirectory the path which iris saves some assets came from the internet ( used in iris control plugin (to download the html,css,js) and for iris command line tool to download the packages).
ErrDirCreate returns an error with message: 'Unable to create directory on '+root dir'.
ErrFileCopy returns an error with message: 'While copying files.
ErrFileCreate returns an error with message: 'While creating a file.
ErrFileDownload returns an error with message: 'While downloading from +specific url.
ErrFileOpen returns an error with message: 'While opening a file.
ErrFileRemove returns an error with message: 'While removing a file.
ErrNoZip returns an error with message: 'While creating file '+filename'.
PathSeparator is the string of os.PathSeparator.

# Structs

BufferPool implements a pool of bytes.Buffers in the form of a bounded channel.
No description provided by the author
Ticker is the timer which is used in cache.

# Interfaces

ITick is the interface which all ticker's listeners must implement.