Documentation
¶
Index ¶
- Constants
- func Chown(targetFilePath, userName, groupName string) error
- func CloseResourceSecure(name string, c io.Closer)
- func CopyLocalFile(sourceFilePath, targetFilePath string, mode os.FileMode) error
- func CreateDirPathIfNeeded(targetFilePath string, mode os.FileMode) error
- func Decode(encodingName string, data []byte) (string, error)
- func DetectCharMap(encodingName string) (encoding.Encoding, error)
- func Diff(expectedStr, actualStr string) string
- func DownloadFile(ctx context.Context, targetLocation string, sourceURL *url.URL, ...) error
- func DownloadFtpFile(ctx context.Context, u *url.URL, targetFilePath string) error
- func DownloadHTTPFile(ctx context.Context, u fmt.Stringer, targetFilePath string) error
- func DownloadHTTPSFile(ctx context.Context, skipTLS bool, u fmt.Stringer, targetFilePath string) error
- func Encode(encodingName, contentsUtf8 string) ([]byte, error)
- func ExtractHashAlgo(hashAlgoName string) (hChecker hash.Hash, err error)
- func FileExists(filePath string) (bool, error)
- func HashEquals(hashStr, filePath string) (hashEquals bool, actualCache string, err error)
- func HashSum(hashAlgoName, filePath string) (hashSum string, err error)
- func MoveFile(sourceFilePath, targetFilePath string) error
- func ParseHashAlgoAndSum(hashStr string) (algoName, sum string, err error)
- func ParseLocationOS(rawLocation string) string
- func ReadEncodedFile(encodingName, fileName string) (contentsUtf8 string, err error)
- func Truncate(data interface{}) string
- func WriteEncodedFile(encodingName, contentsUtf8, fileName string, perm os.FileMode) error
- type CloserFunc
- type Errors
- type FsManager
- func (fmm *FsManager) Chmod(targetFilePath string, mode os.FileMode) error
- func (fmm *FsManager) Chown(targetFilePath, userName, groupName string) error
- func (fmm *FsManager) CopyLocalFile(sourceFilePath, targetFilePath string, mode os.FileMode) error
- func (fmm *FsManager) CreateDirPathIfNeeded(targetFilePath string, mode os.FileMode) error
- func (fmm *FsManager) DownloadFile(ctx context.Context, targetLocation string, sourceURL *url.URL, ...) error
- func (fmm *FsManager) FileExists(filePath string) (bool, error)
- func (fmm *FsManager) MoveFile(sourceFilePath, targetFilePath string) error
- func (fmm *FsManager) ReadEncodedFile(encodingName, fileName string) (contentsUtf8 string, err error)
- func (fmm *FsManager) ReadFile(filePath string) (content string, err error)
- func (fmm *FsManager) Remove(filePath string) error
- func (fmm *FsManager) Stat(name string) (os.FileInfo, error)
- func (fmm *FsManager) WriteFile(name, contents string, mode os.FileMode) error
- type HashManager
- type Location
- type OSDataProvider
Constants ¶
View Source
const ( OSKernel = "taco_os_kernel" // windows, linux, freebsd // see https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63#a-list-of-valid-goos-values OSFamily = "taco_os_family" // darwin, debian, redhat, debian, ”, windows OSPlatform = "taco_os_platform" // darwin, ubuntu, centos, debian, alpine, windows OSName = "taco_os_name" // mac os x, ubuntu, centos linux, debian gnu/linux, alpine linux, windows server 2019 standard OSVersion = "taco_os_version" // 10.15.7, 20.04.1 LTS (Focal Fossa), 8 (Core), 10 (buster), ”, 10.0 Architecture = "taco_architecture" // x86_64 )
Variables ¶
This section is empty.
Functions ¶
func CloseResourceSecure ¶
func CopyLocalFile ¶
func CreateDirPathIfNeeded ¶
func DownloadFile ¶
func DownloadFtpFile ¶
func DownloadHTTPFile ¶
func DownloadHTTPSFile ¶
func FileExists ¶
func HashEquals ¶
func ParseHashAlgoAndSum ¶
func ParseLocationOS ¶
func ReadEncodedFile ¶
Types ¶
type CloserFunc ¶
type CloserFunc struct {
Cf func() error
}
func NewCloserFunc ¶
func NewCloserFunc(f func() error) CloserFunc
func (CloserFunc) Close ¶
func (cf CloserFunc) Close() error
type FsManager ¶
type FsManager struct{}
func (*FsManager) CopyLocalFile ¶
func (*FsManager) CreateDirPathIfNeeded ¶
func (*FsManager) DownloadFile ¶
func (*FsManager) ReadEncodedFile ¶
type HashManager ¶
type HashManager struct{}
func (HashManager) HashEquals ¶
func (hm HashManager) HashEquals(hashStr, filePath string) (hashEquals bool, actualCache string, err error)
type Location ¶
func ParseLocation ¶
type OSDataProvider ¶
type OSDataProvider struct { }
func (OSDataProvider) GetTemplateVariables ¶
func (odp OSDataProvider) GetTemplateVariables() (map[string]interface{}, error)
Click to show internal directories.
Click to hide internal directories.