tools

package
v0.0.0-...-a71d288 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyString        = fmt.Errorf("empty string")
	ErrExpextedFileNotDir = fmt.Errorf("expected file and not a directory")
)

Functions

func CheckFileExists

func CheckFileExists(filePath string) bool

func CheckIsFile

func CheckIsFile(name string) (body string, err error)

func DecryptString

func DecryptString(src string, key []byte) (decryptedString string, err error)

func DevideOwnerAndRepo

func DevideOwnerAndRepo(fullRepo string) (owner string, repo string)

func EncryptString

func EncryptString(src string, key []byte) (encryptedString string, err error)

func GetDefaultBranch

func GetDefaultBranch() string

func GetGitTagMaps

func GetGitTagMaps(gitRepo *git.Repository) (commitToTagMap map[string][]string, tagToCommitMap map[string]string, err error)

func GetGitTagsUpToHead

func GetGitTagsUpToHead(gitRepo *git.Repository) (tags []*semver.Version, err error)

func ReadFileToString

func ReadFileToString(fileOrString string) (result string, err error)

ReadFileToString can find a given file and returns it as a string if the input is not an empty string, the given input is returned

func RunCmd

func RunCmd(cmd string, shell bool) string

Types

type UploadArtifact

type UploadArtifact struct {
	File os.File
	Name string
}

func GetFilesAndInfos

func GetFilesAndInfos(uploadArtifacts *string) (artifacts []UploadArtifact, err error)

deprecated

type UploadAsset

type UploadAsset struct {
	File  os.File
	Name  string
	Infos fs.FileInfo
	IsZip bool
	Hash  []byte
}

func GetAsset

func GetAsset(assetLocation string) (asset *UploadAsset, err error)

Jump to

Keyboard shortcuts

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