io

package
v0.1.1-0...-f02a436 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FetchFile = func(src string) ([]byte, error) {
	var f []byte
	var err error

	if env.Config().GetBool("FetchFromRemote") {
		f, err = fetchFromRemote(src)
	} else {
		f, err = FetchFromLocal(src)
	}

	return f, err
}

FetchFile first tries to retrieve file from local disk (workDir/<Hostname>/). If it fails then connects to Hostname to retrieve file and stores it locally To force a network connection remove workDir/... prior to exec.

Functions

func FetchEnv

func FetchEnv(host, envVar string) (string, error)

FetchEnv Fetch env vars from either the source cluster or localhost

func FetchFromLocal

func FetchFromLocal(src string) ([]byte, error)

FetchFromLocal retrieve file from local WorkDir

func FetchStringSource

func FetchStringSource(stringSource legacyconfigv1.StringSource) (string, error)

FetchStringSource fetches a string from an source cluster

func ReadFile

func ReadFile(file string) ([]byte, error)

ReadFile reads a file from WorkDir and returns its contents

func WriteFile

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

WriteFile writes data to a file into WorkDir

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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