helper

package
v0.0.0-...-195bd42 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package helper contains various helper functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	DeployCount   int32 = 0
	StopCount     int32 = 0
	LogsCount     int32 = 0
	RedeployCount int32 = 0
)

DeployCount is the global number of deploy requests handled

Functions

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string) error

CreateDirIfNotExist creates a given directory if it does not exist

func DeserializeRepo

func DeserializeRepo(gitRepo string) (repoURL string, branch string, completeUrl string)

func Env

func Env(key, fallback string) string

Env returns the value of the environment variable if present, or returns the fallback value

func FileExists

func FileExists(filename string) bool

FileExists returns true if the file exists

func Hash

func Hash(payload, secret, hashType string) (string, error)

Hash hashes a payload, with a secret with a given hash type (sha1 or sha256)

func SerializeRepo

func SerializeRepo(repoName string, branch string) string

func WriteToFile

func WriteToFile(filePath, text string) error

WriteToFile writes a given string to a file. It creates the file if it is not present

Types

This section is empty.

Jump to

Keyboard shortcuts

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