utils

package
v0.0.0-...-5c7c43f Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWS       = "AWS"
	BOSH      = "Bosh"
	DOCKER    = "Docker"
	SOFTLAYER = "SoftLayer"
	SL        = "SL"
)
View Source
const CBBROKER_TRACE = "CBBROKER_TRACE"

Variables

This section is empty.

Functions

func CopyFilePaths

func CopyFilePaths(fromPath, toPath string) (err error)

func CopyPathToWriter

func CopyPathToWriter(originalFilePath string, targetWriter io.Writer) (err error)

func CopyReaderToPath

func CopyReaderToPath(src io.Reader, targetPath string) (err error)

func CreateFile

func CreateFile(path string) (file *os.File, err error)

func Exists

func Exists(path string) bool

func ExtractVarsFromRequest

func ExtractVarsFromRequest(r *http.Request, varName string) string

func GeneratePublicKey

func GeneratePublicKey(privateKey []byte) (string, error)

func GetPath

func GetPath(paths []string) string

func GetSshClient

func GetSshClient(username string, privateKey []byte, ip string) (*awsSshClient, error)

func IsDirEmpty

func IsDirEmpty(dir string) (isEmpty bool, err error)

func MarshalAndRecord

func MarshalAndRecord(object interface{}, dir string, fileName string) error

func MarshalPublickKey

func MarshalPublickKey(key ssh.PublicKey) string

func MkDir

func MkDir(path string) bool

func OpenFile

func OpenFile(path string) (file *os.File, err error)

func ProvisionDataFromRequest

func ProvisionDataFromRequest(r *http.Request, object interface{}) error

func ReadAndUnmarshal

func ReadAndUnmarshal(object interface{}, dir string, fileName string) error

func ReadFile

func ReadFile(path string) (content []byte, err error)

func ReadFile2

func ReadFile2(file *os.File) string

func SetExecutableBits

func SetExecutableBits(dest string, fileInfoToCopy os.FileInfo) (err error)

func SetExecutableBitsWithPaths

func SetExecutableBitsWithPaths(dest string, src string) (err error)

func SetStdout

func SetStdout(s io.Writer)

func WriteFile

func WriteFile(path string, content []byte) error

func WriteResponse

func WriteResponse(w http.ResponseWriter, code int, object interface{})

Types

type Printer

type Printer interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
	Println(v ...interface{})
}
var Logger Printer

func NewLogger

func NewLogger() Printer

type SshClient

type SshClient interface {
	Close() error
	ExecCommand(command string) (string, error)
}

Jump to

Keyboard shortcuts

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