file

package
v0.0.0-...-159d35f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPath

func FromPath(path, pattern string) ([]string, error)

From a file or dir path returns an array of flat file paths pattern is a filepath.Match pattern to limit files to a pattern

func ToObjects

func ToObjects(paths []string) ([]client.Object, error)

from a list of paths, returns an array of runtime objects

func TrimExt

func TrimExt(path string) string

TrimExt removes the ext of a file path, foo.tar == foo

func UnTar

func UnTar(dest string, r io.Reader, compressed bool) (err error)

UnTar untars a tar or tgz file into the dest folder. dest is the folder location io.Reader is a reader that is tar (or compressed tar) format compressed is true if reader is a compressed format

func UntarInPlace

func UntarInPlace(path string) error

UntarInPlace untars a .tar file using the same name as the file as the sub-folder name in the folder it was referenced in. i.e., /opt/foo.tar will land in /opt/foo supports tar and tgz file formats

Types

This section is empty.

Jump to

Keyboard shortcuts

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