files

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 7 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContentCollision = fmt.Errorf("content collision")

Functions

func ToNixPath

func ToNixPath(path string) string

ToNixPath converts the given path to a nix-style path.

Windows-style path separators are considered escape characters by some libraries, which can cause issues.

Types

type Content

type Content struct {
	Source      string           `yaml:"src,omitempty"`
	Destination string           `yaml:"dst,omitempty"`
	Type        string           `yaml:"type,omitempty"`
	Packager    string           `yaml:"packager,omitempty"`
	FileInfo    *ContentFileInfo `yaml:"file_info,omitempty"`
}

Content describes the source and destination of one file to copy into a package.

func (*Content) IsDir

func (c *Content) IsDir() bool

IsDir to part of the os.FileInfo interface

func (*Content) ModTime

func (c *Content) ModTime() time.Time

ModTime to part of the os.FileInfo interface

func (*Content) Mode

func (c *Content) Mode() os.FileMode

Mode to part of the os.FileInfo interface

func (*Content) Name

func (c *Content) Name() string

Name to part of the os.FileInfo interface

func (*Content) Size

func (c *Content) Size() int64

Size to part of the os.FileInfo interface

func (*Content) Sys

func (c *Content) Sys() interface{}

Sys to part of the os.FileInfo interface

func (*Content) WithFileInfoDefaults

func (c *Content) WithFileInfoDefaults() *Content

type ContentFileInfo

type ContentFileInfo struct {
	Owner string      `yaml:"owner,omitempty"`
	Group string      `yaml:"group"`
	Mode  os.FileMode `yaml:"mode,omitempty"`
	MTime time.Time   `yaml:"mtime,omitempty"`
	Size  int64       `yaml:"-"`
}

type Contents

type Contents []*Content

Contents list of Content to process.

func ExpandContentGlobs

func ExpandContentGlobs(contents Contents, disableGlobbing bool) (files Contents, err error)

ExpandContentGlobs gathers all of the real files to be copied into the package.

func (Contents) Len

func (c Contents) Len() int

func (Contents) Less

func (c Contents) Less(i, j int) bool

func (Contents) Swap

func (c Contents) Swap(i, j int)

Jump to

Keyboard shortcuts

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