utils

package
v0.0.0-...-6d1d515 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AWS       = "AWS"
	SOFTLAYER = "SoftLayer"
	SL        = "SL"
)

Variables

This section is empty.

Functions

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 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 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 WriteFile

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

func WriteResponse

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

Types

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