util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CertFile contains the address for the API's TLS certificate.
	CertFile = "api/api-tls-cert.pem"
	// KeyFile contains the address for the API's TLS certificate key file.
	KeyFile = "api/api-tls-key.pem"
)

Variables

This section is empty.

Functions

func GetAllLinesButLast

func GetAllLinesButLast(s string) []string

GetAllLinesButLast receives a string with multiple lines and returns all but the last line.

func GetLastLine

func GetLastLine(s string) string

GetLastLine receives a string with multiple lines and returns it's last

func HandleCmd

func HandleCmd(repositoryURL, repositoryBranch, cmd string) string

HandleCmd will extract %GIT_REPO% and %GIT_BRANCH% from cmd and replace it with the proper repository URL.

func HandlePrivateSSHKey

func HandlePrivateSSHKey(rawString string) string

HandlePrivateSSHKey will extract %GIT_PRIVATE_SSH_KEY% from cmd and replace it with the proper private SSH key.

func RemoveDuplicates

func RemoveDuplicates(s []string) []string

RemoveDuplicates remove duplicated itens from a slice.

func RequestResponse

func RequestResponse(success bool, errMsg string) map[string]interface{}

RequestResponse returns a map string interface to be used in echo JSON requests response.

func SanitizeSafetyJSON

func SanitizeSafetyJSON(s string) string

SanitizeSafetyJSON returns a sanitized string from Safety container logs. Safety might return a JSON with the "\" and "\"" characters, which needs to be sanitized to be unmarshalled correctly.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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