Documentation ¶
Index ¶
- type CachePackage
- type CacheResponse
- type FilePackage
- func (c *FilePackage) AppendString(filename string, text string) FileResponse
- func (c *FilePackage) Copy(src, dst string) FileResponse
- func (c *FilePackage) Delete(filename string) FileResponse
- func (c *FilePackage) Exists(filename string) FileResponse
- func (c *FilePackage) Move(src, dst string) FileResponse
- func (c *FilePackage) Read(fileName string) FileResponse
- func (c *FilePackage) Truncate(filename string, size int64) FileResponse
- func (c *FilePackage) Write(fileName string, data []byte) FileResponse
- type FileResponse
- type HTTPPackage
- func (c *HTTPPackage) DownloadFile(filepath string, method string, uri string, headers interface{}, ...) HTTPResponse
- func (c *HTTPPackage) Get(url string, headers map[string]string) HTTPResponse
- func (c *HTTPPackage) Post(url string, headers map[string]string, data interface{}) HTTPResponse
- func (c *HTTPPackage) Request(method string, uri string, headers interface{}, data interface{}) HTTPResponse
- func (c *HTTPPackage) UploadFile(filename string, fieldname string, method string, uri string, ...) HTTPResponse
- type HTTPResponse
- type LogPackage
- type StringsPackage
- type StringsResponse
- type UtilPackage
- type UtilResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachePackage ¶ added in v0.8.2
type CachePackage struct{}
CachePackage contains methods for use the cache (local or global)
func GetCache ¶ added in v0.8.2
func GetCache() *CachePackage
GetCache returns the FilePackage struct
func (*CachePackage) Get ¶ added in v0.8.2
func (c *CachePackage) Get(k string) *CacheResponse
Get return a cache item if it exists
func (*CachePackage) Put ¶ added in v0.8.2
func (c *CachePackage) Put(k, v string, ttl int64)
Put add a new value in the cache
type CacheResponse ¶ added in v0.8.2
CacheResponse contains the return values
type FilePackage ¶
type FilePackage struct{}
FilePackage contains file manipulation methods
func (*FilePackage) AppendString ¶
func (c *FilePackage) AppendString(filename string, text string) FileResponse
AppendString opens the file in appending mode and write text on it
func (*FilePackage) Copy ¶
func (c *FilePackage) Copy(src, dst string) FileResponse
Copy handles the copy of a file to another file
func (*FilePackage) Delete ¶
func (c *FilePackage) Delete(filename string) FileResponse
Delete removes a file
func (*FilePackage) Exists ¶
func (c *FilePackage) Exists(filename string) FileResponse
Exists returns true if the file exists
func (*FilePackage) Move ¶
func (c *FilePackage) Move(src, dst string) FileResponse
Move renames a file
func (*FilePackage) Read ¶ added in v0.10.0
func (c *FilePackage) Read(fileName string) FileResponse
func (*FilePackage) Truncate ¶
func (c *FilePackage) Truncate(filename string, size int64) FileResponse
Truncate set file length to size
func (*FilePackage) Write ¶ added in v0.10.0
func (c *FilePackage) Write(fileName string, data []byte) FileResponse
type FileResponse ¶
FileResponse contains the return values
type HTTPPackage ¶
type HTTPPackage struct{}
HTTPPackage contains all the methods to perform http requests
func (*HTTPPackage) DownloadFile ¶
func (c *HTTPPackage) DownloadFile(filepath string, method string, uri string, headers interface{}, data interface{}) HTTPResponse
DownloadFile gets a file from an URL and store in on disk
func (*HTTPPackage) Get ¶
func (c *HTTPPackage) Get(url string, headers map[string]string) HTTPResponse
Get performs a GET request
func (*HTTPPackage) Post ¶
func (c *HTTPPackage) Post(url string, headers map[string]string, data interface{}) HTTPResponse
Post performs a POST request
func (*HTTPPackage) Request ¶
func (c *HTTPPackage) Request(method string, uri string, headers interface{}, data interface{}) HTTPResponse
Request performs a HTTP request
func (*HTTPPackage) UploadFile ¶
func (c *HTTPPackage) UploadFile(filename string, fieldname string, method string, uri string, headers interface{}, data interface{}) HTTPResponse
UploadFile sends a file to an URL
type HTTPResponse ¶
HTTPResponse contains the return values
type LogPackage ¶
type LogPackage struct{}
LogPackage contains logs methods
func (*LogPackage) Debug ¶
func (l *LogPackage) Debug(format string, a ...interface{})
Debug prints a debug line on the logs
func (*LogPackage) Error ¶
func (l *LogPackage) Error(format string, a ...interface{})
Error prints an error line on the logs
func (*LogPackage) Info ¶
func (l *LogPackage) Info(format string, a ...interface{})
Info prints an info line on the logs
type StringsPackage ¶
type StringsPackage struct{}
StringsPackage contains string manipulation methods
func (*StringsPackage) StartsWith ¶
func (c *StringsPackage) StartsWith(str, substr string) StringsResponse
StartsWith returns true if a string start with a substring
type StringsResponse ¶
StringsResponse contains the return values
type UtilPackage ¶
type UtilPackage struct{}
UtilPackage contains useful generic methods
func (*UtilPackage) Getenv ¶
func (c *UtilPackage) Getenv(name string) UtilResponse
Getenv returns an environment variable if it exists
func (*UtilPackage) Md5File ¶ added in v0.8.2
func (c *UtilPackage) Md5File(filename string) UtilResponse
Md5File returns the MD5 hash of the file
func (*UtilPackage) Sleep ¶
func (c *UtilPackage) Sleep(seconds int) UtilResponse
Sleep call Sleep method for N seconds
type UtilResponse ¶
UtilResponse contains the return values