bindata

package
v1.20210227.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package bindata containers helpers for linking binary assets into programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	PackageName string
	Ignores     []*regexp.Regexp
}

Bundle is an assets bundle with associated options.

func (*Bundle) Finish

func (b *Bundle) Finish(output io.Writer) error

Finish closes out the output file

func (*Bundle) PackageNameOrDefault

func (b *Bundle) PackageNameOrDefault() string

PackageNameOrDefault returns the package name or a default.

func (*Bundle) ProcessPath

func (b *Bundle) ProcessPath(output io.Writer, pc PathConfig) error

ProcessPath processes a path with a given config.

func (*Bundle) Start

func (b *Bundle) Start(output io.Writer) error

Start writes the file preamble.

type ByteWriter

type ByteWriter struct {
	io.Writer
	Indent []byte
	// contains filtered or unexported fields
}

ByteWriter writes escaped bytes to a writer.

func NewByteWriter

func NewByteWriter(wr io.Writer) *ByteWriter

NewByteWriter returns a new byte writer.

func (*ByteWriter) Write

func (w *ByteWriter) Write(p []byte) (n int, err error)

type File

type File struct {
	Name     string
	Modtime  time.Time
	Contents *FileCompressor
}

File is both the file metadata and the contents.

type FileCompressor

type FileCompressor struct {
	Source io.ReadCloser
	MD5    hash.Hash
}

FileCompressor reads a file an returns compressed output.

func NewFileCompressor

func NewFileCompressor(src io.ReadCloser) *FileCompressor

NewFileCompressor returns a new file compressor.

func (*FileCompressor) Close

func (fc *FileCompressor) Close() error

Close closes the source stream.

func (*FileCompressor) WriteTo

func (fc *FileCompressor) WriteTo(dst io.Writer) (written int64, err error)

WriteTo copies the source to the destination as a compressed output. It also sums the source into the MD5 hash (uncompressed)>

type PathConfig

type PathConfig struct {
	Path      string
	Recursive bool
}

PathConfig is a path config.

Jump to

Keyboard shortcuts

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