utils

package
v0.0.0-...-53371f3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: ISC Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyFileStructure = FileStructure{}

Functions

func AbsPath

func AbsPath(rel string) string

func ArrString

func ArrString(something interface{}) []string

func BuildDependencyFromString

func BuildDependencyFromString(defaultProvider string, dep string) map[string]interface{}

func BuildStringFromDependency

func BuildStringFromDependency(dep map[string]interface{}) string

func Contains

func Contains(s interface{}, elem interface{}) bool

func CopyFiles

func CopyFiles(files []string, destination string) error

func DIRNAME

func DIRNAME() string

func Dir

func Dir(path string) (matches []string, err error)

func ExecCommand

func ExecCommand(toRun string, args []string) error

func FileExists

func FileExists(path string) bool

func GetOrCreateRepo

func GetOrCreateRepo(path string) map[string]interface{}

func GupmConfig

func GupmConfig() gupmEntryPointConfig

func HOMEDIR

func HOMEDIR(fallback string) string

func HttpGet

func HttpGet(url string) []byte

func IsDirectory

func IsDirectory(path string) bool

func OSNAME

func OSNAME() string

func Path

func Path(path string) string

func ReadDir

func ReadDir(path string) ([]os.FileInfo, error)

func ReadJSON

func ReadJSON(path string, target interface{}) error

func RecursiveFileWalkDir

func RecursiveFileWalkDir(source string) []string

func RemoveFiles

func RemoveFiles(files []string) error

func RemoveIndex

func RemoveIndex(s []map[string]interface{}, index int) []map[string]interface{}

func RunCommand

func RunCommand(toRun string, args []string) (string, error)

func SaveLockDep

func SaveLockDep(path string)

func SaveRepo

func SaveRepo(path string, file map[string]interface{})

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringToJSON

func StringToJSON(b string) map[string]interface{}

func WriteFile

func WriteFile(path string, file string) error

func WriteJsonFile

func WriteJsonFile(path string, file map[string]interface{})

Types

type Dependency

type Dependency struct {
	Name     string
	Provider string
	Version  string
}

type FileStructure

type FileStructure struct {
	Children map[string]FileStructure
	Name     string
	Content  []byte
	Filetype int
}

func Tar

func Tar(files []string) (FileStructure, error)

func Ungz

func Ungz(r string) (FileStructure, error)

func Untar

func Untar(r string) (FileStructure, error)

func Unzip

func Unzip(r string) (FileStructure, error)

func (*FileStructure) SaveAt

func (g *FileStructure) SaveAt(path string) error

func (*FileStructure) SaveSelfAt

func (g *FileStructure) SaveSelfAt(path string) error

type GupmEntryPoint

type GupmEntryPoint struct {
	Name              string
	Version           string
	WrapInstallFolder string
	Git               gupmEntryPointGit
	Publish           gupmEntryPointPublish
	Cli               gupmEntryPointCliList
	Config            gupmEntryPointConfigList
	Dependencies      gupmEntryPointDependenciesList
}

func ReadGupmJson

func ReadGupmJson(path string) (*GupmEntryPoint, error)

type Json

type Json map[string]interface{}

type Json map[interface{}]interface {}

func (*Json) Contains

func (j *Json) Contains(test interface{}) bool

Jump to

Keyboard shortcuts

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