lib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenID        = "NSCONF_TOKEN_ID"
	TokenSecret    = "NSCONF_TOKEN_SECRET"
	ConsumerKey    = "NSCONF_CONSUMER_KEY"
	ConsumerSecret = "NSCONF_CONSUMER_SECRET"
	Password       = "NSCONF_PASSWORD"
	Account        = "NSCONF_ACCOUNT"
	Email          = "NSCONF_EMAIL"
	Realm          = "NSCONF_REALM"
	CliToken       = "NSCONF_CLITOKEN"
	HashFile       = "NSCONF_HASHFILE"
	Role           = "NSCONF_ROLE"
	URL            = "NSCONF_URL"

	SdfCliConsumerKey    = "" /* 160-byte string literal not displayed */
	SdfCLiConsumerSecret = "" /* 160-byte string literal not displayed */
	SdfCliPw             = "&Get File List"

	JavaVersion       = "8u181"
	JavaBuildNumber   = "13"
	JavaPlatformLinux = "linux-x64.tar.gz"
	JavaSubDirLinux   = ""
	JavaPlatformMac   = "macosx-x64.tar.gz"
	JavaSubDirMac     = "/Contents/Home"

	// URLSdfCore dependency urls
	URLSdfCore         = "https://system.netsuite.com/download/ide/update_18_1/plugins/com.netsuite.ide.core_2018.1.2.jar"
	URLSdfIde          = "https://system.netsuite.com/download/ide/update_18_1/plugins/com.netsuite.ide.eclipse.ws_2018.1.2.jar"
	URLSdfSupplemental = "https://system.netsuite.com/core/media/media.nl?id=95083164&c=NLCORP&h=37e6a602c5c4fc0fb3e3&_xt=.gz"
	URLMaven           = "http://artfiles.org/apache.org/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz"
)

Variables

View Source
var (
	Credentials map[string]string
	// paths to deps
	CurrentDir   string
	Dependencies string
	SdfCli       string
	CliCache     string
	// IsVerbose variable for export
	IsVerbose = false
	IsDebug   = false

	// Whitelisted filenames hat are not included while uploading the files
	Whitelisted = []string{"error.log"}
	// constructed java base url
	JavaBaseURL = strings.Join([]string{"http://download.oracle.com/otn-pub/java/jdk/", JavaVersion, "-b", JavaBuildNumber, "/96a7b8442fe848ef90c96a2fad6ed6d1/jre-", JavaVersion, "-"}, "")
)

global variables

Functions

func AbsolutePath added in v0.0.3

func AbsolutePath(path string) string

AbsolutePath get absolute path if it is relative

func ArrayIncludes

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

ArrayIncludes check if array includes

func CheckCliCache added in v0.0.3

func CheckCliCache() []byte

CheckCliCache test and set the cli cache token

func CheckDir

func CheckDir(p string) error

CheckDir check if path is directory and exists

func CheckExists

func CheckExists(p string) (s os.FileInfo, err error)

CheckExists returns whether the given file or directory exists or not

func CheckRequired added in v0.0.3

func CheckRequired(s []string, i int, arg string) string

CheckRequired check if required arg exists

func Copy

func Copy(src, dst string) error

Copy the src file to dst. Any existing file will be overwritten

func DecryptCliToken

func DecryptCliToken(currentKey string, creds map[string]string) error

DecryptCliToken decrypt the given token by using the key

func Difference

func Difference(slice1 []string, slice2 []string) (dStr []string, dInt []int)

Difference of slice1 to slice2

func EncryptCliToken

func EncryptCliToken(currentKey string, creds map[string]string) (string, error)

EncryptCliToken encrypt the given key and secrets

func FindDir added in v0.0.3

func FindDir(pathS, rx string) (found []string)

FindDir find dirs recursively by regex

func InitEnv

func InitEnv(skipAuthReq bool) (err error)

InitEnv init the environment used by the cli

func MkTempDir

func MkTempDir() string

MkTempDir create temporary dir

func NormalizeRootPath

func NormalizeRootPath(p string, root string, remote string) string

NormalizeRootPath normalize the remote path and return localpath

func OptArgDest added in v0.0.3

func OptArgDest(args cli.Args, i int, def string) string

OptArgDest set default for optional arg

func OptDest added in v0.0.3

func OptDest(d string, def string) (s string)

OptDest set default for optional destination

func PrFatalf

func PrFatalf(format string, a ...interface{})

PrFatalf log fatal

func PrHeaderf added in v0.0.3

func PrHeaderf(format string, a ...interface{})

PrHeaderf print underlined header

func PrNoticef added in v0.0.3

func PrNoticef(format string, a ...interface{})

PrNoticef print dimmed notice

func PrResultf added in v0.0.3

func PrResultf(format string, a ...interface{})

PrResultf print green result

func PrWarnf added in v0.0.3

func PrWarnf(format string, a ...interface{})

PrWarnf print bold warning

func PrettyHash

func PrettyHash(str string, list []Hash)

PrettyHash output list prettified for terminal

func PrettyList

func PrettyList(str string, list []string)

PrettyList output list prettified for terminal

func PrettyTable added in v0.0.3

func PrettyTable(caption string, header []string, data [][]string)

PrettyTable markdown style table output

func PrintResponse

func PrintResponse(s string, a []DeleteResult)

PrintResponse print delete response prettified

func Remove

func Remove(p string)

Remove remove directory

func ToJSON added in v0.0.3

func ToJSON(p interface{}) []byte

ToJSON convert interface to json

Types

type DeleteResult added in v0.0.3

type DeleteResult struct {
	Successful bool
	NotFound   bool
	Code       string
	Message    string
	ID         string
	Type       string
}

DeleteResult struct

type EnvVar

type EnvVar struct {
	// contains filtered or unexported fields
}

EnvVar struct for env and default values

type Hash

type Hash struct {
	Path string
	Hash string
	Name string
}

Hash struct

func DirContent

func DirContent(dir string, prefix string, hash bool, exclude bool) ([]Hash, error)

DirContent get all files from a directory and their hashes

type Meta added in v0.0.3

type Meta struct {
	Successful   bool
	TotalPages   int
	TotalRecords int
	SearchID     string
}

Meta struct

type SearchResult added in v0.0.3

type SearchResult struct {
	InternalID string
	Parent     string
	Name       string
	Children   []*SearchResult
	IsDir      bool
	Path       string
}

SearchResult struct

Jump to

Keyboard shortcuts

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