util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

You can use the "packr clean" command to clean up this, and any other packr generated files.

Index

Constants

View Source
const (
	EnvironmentError = 1
	FileNotFound     = 2
	InvalidTemplate  = 3
	ArgMissing       = 4
	NetworkError     = 5
)
View Source
const (
	JavaSpring = "java-spring"
)

Variables

View Source
var (
	TempDirectory   string
	OutputDirectory string
)

Functions

func CreateDirIfNotExists

func CreateDirIfNotExists(dir *string)

func Error

func Error(err error) bool

func Exists

func Exists(path string) (bool, error)

exists returns whether the given file or directory exists

func GenerateTemporaryFileName

func GenerateTemporaryFileName() (string, error)

func GetSpringTemplate

func GetSpringTemplate(templateName string) (string, error)

func GetValue

func GetValue(cmd *cobra.Command, key string) string

func GetValueBool

func GetValueBool(cmd *cobra.Command, key string) bool

func GetValueInt32

func GetValueInt32(cmd *cobra.Command, key string) int32

func GetValues

func GetValues(cmd *cobra.Command, key string) []string

func GitAddAll

func GitAddAll(repoPath string)

func GitAddRemote

func GitAddRemote(repoPath string, repositoryUrl string)

func GitCommit

func GitCommit(repoPath string, message string)

func GitInitNewRepo

func GitInitNewRepo(repoPath string)

func LogAndExit

func LogAndExit(err error, exitCode int)

func LogMessageAndExit

func LogMessageAndExit(message string)

func MakeHttpRequest

func MakeHttpRequest(req *http.Request, ch chan<- ChannelResponse)

func ParseTemplate

func ParseTemplate(templateData interface{}, templateFile, templateStr string) (string, error)

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). Reference https://golangcode.com/unzip-files-in-go/

func ValidateRequired

func ValidateRequired(value, key string)

Types

type ChannelResponse

type ChannelResponse struct {
	Success bool
	Error   error
	Data    []byte
}

type Git

type Git struct {
	RepositoryUrl string
}

Jump to

Keyboard shortcuts

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