utils

package
v0.0.0-...-e0ee0a9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExternalBinaryPaths = []string{"/usr/sbin", "/sbin", "/usr/local/sbin"}
)

Functions

func AppendStructToMap

func AppendStructToMap(Struct interface{}, Map map[string]interface{}) error

func GetBinaryPath

func GetBinaryPath(command string) (string, error)

func MarshallStructToMap

func MarshallStructToMap(Struct interface{}) (map[string]interface{}, error)

func StringsMatchingWildcards

func StringsMatchingWildcards(attributes, wildcards []string) ([]string, error)

Given a string list containing attribute names, and a string list containing attribute name wildcard expressions, return the list of attributes that match at least one of the expressions. Only '*' wildcard is supported at the moment, matching any number of characters, including zero.

This is intended to be used to match `artifact_provides` attributes against `clears_artifact_provides` attributes.

Types

type ProgressReader

type ProgressReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func NewProgressReader

func NewProgressReader() *ProgressReader

func (*ProgressReader) Read

func (p *ProgressReader) Read(b []byte) (int, error)

func (*ProgressReader) Wrap

func (p *ProgressReader) Wrap(r io.Reader, size int64) io.Reader

type ProgressWriter

type ProgressWriter struct {
	Writer io.WriteCloser
	// contains filtered or unexported fields
}

func NewProgressWriter

func NewProgressWriter() *ProgressWriter

func (*ProgressWriter) Finish

func (p *ProgressWriter) Finish()

func (*ProgressWriter) Reset

func (p *ProgressWriter) Reset(size int64, filename string, payloadNumber int)

func (*ProgressWriter) Wrap

func (p *ProgressWriter) Wrap(w io.WriteCloser) io.Writer

func (*ProgressWriter) Write

func (p *ProgressWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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