Help us shape the future of Go! Take the 2026 Go Developer Survey

plugins

package
v1.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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

type CacheResponse struct {
	Error  error
	Status bool
	Value  string
}

CacheResponse contains the return values

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

type FileResponse struct {
	Error  error
	Status bool
	Binary []byte
	String string
}

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) Base64Decode added in v1.26.8

func (c *UtilPackage) Base64Decode(str string) UtilResponse

Base64Decode decodes a base64 encoded string

func (*UtilPackage) Base64Encode added in v1.26.8

func (c *UtilPackage) Base64Encode(str string) UtilResponse

func (*UtilPackage) ExecCommand added in v1.26.8

func (c *UtilPackage) ExecCommand(commandParts []string, inputData string) UtilResponse

Ecexute shell command

func (*UtilPackage) Getenv

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

Getenv returns an environment variable if it exists

func (*UtilPackage) HexDecode added in v1.26.8

func (c *UtilPackage) HexDecode(str string) UtilResponse

HexDecode decodes a hex encoded string

func (*UtilPackage) HexEncode added in v1.26.8

func (c *UtilPackage) HexEncode(str string) UtilResponse

HexEncode encodes a string to hex

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) Sha1File added in v1.20.0

func (c *UtilPackage) Sha1File(filename string) UtilResponse

Sha1File returns the SHA1 hash of the file

func (*UtilPackage) Sha256File added in v1.20.0

func (c *UtilPackage) Sha256File(filename string) UtilResponse

Sha256File returns the SHA256 hash of the file

func (*UtilPackage) Sha512File added in v1.20.0

func (c *UtilPackage) Sha512File(filename string) UtilResponse

Sha512File returns the SHA512 hash of the file

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