foundation

package
v0.0.0-...-1941b44 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = iota
	Deflate
	GZ
	BZip2
	LZMA
	XZ
	LZ4
	Brotli
	Zstandard
)

Compression Algorithm

View Source
const DefaultResponseFile = "compress.rsp.json"

DefaultResponseFile default response file

Variables

View Source
var (
	ErrRelativePathEscape = errors.New("relative path escape")
	ErrResponseFilesField = errors.New("response files field error")
)

Error define

Functions

func HardLink(oldname string, newname string) error

HardLink todo

func IsRelativePath

func IsRelativePath(basepath, childpath string) bool

IsRelativePath todo

func PathIsExists

func PathIsExists(p string) bool

PathIsExists todo

func SymbolicLink(oldname string, newname string) error

SymbolicLink todo

Types

type ExtractOptions

type ExtractOptions struct {
	OverwriteExisting bool
	MkdirAll          bool
	IgnoreError       bool
	FilenameEncoding  string
	Password          string
	PassworldCallback func() string
	ProgressBar       io.Writer
	// contains filtered or unexported fields
}

ExtractOptions todo

func (*ExtractOptions) OnEntry

func (es *ExtractOptions) OnEntry(name string)

OnEntry on entry

func (*ExtractOptions) UpdateWidth

func (es *ExtractOptions) UpdateWidth()

UpdateWidth todo

type File

type File struct {
	URL         string `json:"url,omitempty"`
	Hash        string `json:"hash,omitempty"`
	Path        string `json:"path,omitempty"`
	Destination string `json:"destination"`
	Name        string `json:"name,omitempty"`        // if not exists use filepath.Base
	Executabled bool   `json:"executabled,omitempty"` // when mark executabled. a script create under windows can run linux
}

File compress file

func (*File) BuildPath

func (file *File) BuildPath() string

BuildPath todo

func (*File) Prepare

func (file *File) Prepare() error

Prepare check file

type ResponseFile

type ResponseFile struct {
	Destination   string   `json:"destination"`
	CompressLevel int      `json:"level,omitempty"`
	Method        string   `json:"method,omitempty"`
	Files         []File   `json:"files,omitempty"`
	Dirs          []string `json:"dirs,omitempty"`
	// contains filtered or unexported fields
}

ResponseFile todo

func NewResponseFile

func NewResponseFile(src string) (*ResponseFile, error)

NewResponseFile response file

Jump to

Keyboard shortcuts

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