utils

package
v0.0.0-...-036f9fd Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZipFileFromProject

func CreateZipFileFromProject(projectPath string, skipCleanup bool) (string, error, func())

CreateZipFileFromProject if the given projectPath contains a directory, zip it and return the zip file path.

Otherwise, leave it as it is.

@param projectPath Project path @param skipCleanup Whether to clean the temporary files after the program exists @return string Path to the zip file @return error @return func() can be called to cleanup the temporary items created during this function execution. Needs to call

this once the zip file is consumed

func ExtractArchive

func ExtractArchive(src string) (string, error)

ExtractArchive extracts the API and give the path. In API Manager archive there is a directory in the root which contains the API this function returns it appended to the destination path

func Unzip

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

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2). returns a slice of extracted files with relative paths(dest is not appended)

func Zip

func Zip(source, target string) error

Zip will create an archive from source and store it in target

Types

This section is empty.

Jump to

Keyboard shortcuts

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