plugins

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilePackage

type FilePackage struct{}

FilePackage contains file manipulation methods

func GetFile

func GetFile() *FilePackage

GetFile returns the FilePackage struct

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) Truncate

func (c *FilePackage) Truncate(filename string, size int64) FileResponse

Truncate set file length to size

type FileResponse

type FileResponse struct {
	Error  error
	Status bool
}

FileResponse contains the return values

type HTTPPackage

type HTTPPackage struct{}

HTTPPackage contains all the methods to perform http requests

func GetHTTP

func GetHTTP() *HTTPPackage

GetHTTP returns the HTTPPackage

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

type HTTPResponse struct {
	Error    error
	Response *http.Response
	Raw      []byte
	Body     string
	Status   bool
}

HTTPResponse contains the return values

type LogPackage

type LogPackage struct{}

LogPackage contains logs methods

func GetLog

func GetLog() *LogPackage

GetLog returns the LogPackage

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 GetStrings

func GetStrings() *StringsPackage

GetStrings returns a StringsPackage

func (*StringsPackage) StartsWith

func (c *StringsPackage) StartsWith(str, substr string) StringsResponse

StartsWith returns true if a string start with a substring

type StringsResponse

type StringsResponse struct {
	Error  error
	Status bool
}

StringsResponse contains the return values

type UtilPackage

type UtilPackage struct{}

UtilPackage contains useful generic methods

func GetUtil

func GetUtil() *UtilPackage

GetUtil returns an UtilPackage

func (*UtilPackage) Getenv

func (c *UtilPackage) Getenv(name string) UtilResponse

Getenv returns an environment variable if it exists

func (*UtilPackage) Sleep

func (c *UtilPackage) Sleep(seconds int) UtilResponse

Sleep call Sleep method for N seconds

type UtilResponse

type UtilResponse struct {
	Error  error
	Status bool
	Value  string
}

UtilResponse contains the return values

Jump to

Keyboard shortcuts

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