util

package
v2.5.85+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIPostLogin

func APIPostLogin(endpoint, username, password, proxy, cookie string) ([]byte, error)

APIPostLogin send a post to get the auth token

func BytesToString

func BytesToString(b []byte) string

BytesToString convert an array of bytes to a string

func GetActionLabel

func GetActionLabel(action string) string

GetActionLabel returns the properly formatted string according to the constant action

func GetDirectFolder

func GetDirectFolder(path string) string

GetDirectFolder returns the file closest folder

func GetExtension

func GetExtension(path string) string

GetExtension returns the file extension

func GetOutputDebug

func GetOutputDebug(code, debug string) string

GetOutputDebug formats the string from the debug when it has errors or warnings

func GetPathFolder

func GetPathFolder(path string) string

GetPathFolder returns only the folders without filename and extension

func GetPathSeparator

func GetPathSeparator() string

GetPathSeparator returns the folder separator by OS

func GetPathWithoutExtension

func GetPathWithoutExtension(path string) string

GetPathWithoutExtension returns the folders and filename without the file extension

func GetStatusColorFromOutput

func GetStatusColorFromOutput(code string) (string, string)

GetStatusColorFromOutput returns the status and color from the output struct

func JSONAvoidEscapeText

func JSONAvoidEscapeText(data []byte) []byte

JSONAvoidEscapeText avoid escaping caracters like <, > and & from json byte array

func ReplacePathSeparatorByOS

func ReplacePathSeparatorByOS(path string) string

ReplacePathSeparatorByOS returns path with right folder separator by OS

func RestCall

func RestCall(jsonString []byte, endpoint, method, token, proxy, cookie string, params map[string]string) ([]byte, int, error)

RestCall executes a rest call to the defined environment executing a json

func RightPad

func RightPad(s, padStr string, length int) string

RightPad insert a defined number of characters on the right of the string

func SoapCall

func SoapCall(request, endpoint, proxy string) (string, error)

SoapCall executes a soap call to the defined environment executing the xog xml

func Unzip

func Unzip(src, destinationFolder string) ([]string, error)

Unzip extract the files from a zip

func ValidateFolder

func ValidateFolder(folder string) error

ValidateFolder creates the folder structure if it do not exists

Types

type Rest

type Rest func(jsonString []byte, endpoint, method, token, proxy, cookie string, params map[string]string) ([]byte, int, error)

Rest defines a rest interface to simplify the unit tests

type Soap

type Soap func(request, endpoint, proxy string) (string, error)

Soap defines a soap interface to simplify the unit tests

Jump to

Keyboard shortcuts

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