io

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutputTo

func OutputTo(files []File, dest string) error

func OutputToFS

func OutputToFS(fs afero.Fs, files []File, dest string) error

Types

type CountingWriter

type CountingWriter struct {
	Delegate     io.Writer
	BytesWritten int
}

func (*CountingWriter) Write

func (w *CountingWriter) Write(p []byte) (int, error)

type File

type File interface {
	Path() string
	WriteTo(io.Writer) (int64, error)
	Clone() File
}

type FileRef

type FileRef struct {
	FPath          string
	RootConfigPath string
}

FileRef is a lightweight representation of a file, deferring reading its contents until `WriteTo` is called.

func (*FileRef) Clone

func (r *FileRef) Clone() File

func (*FileRef) Path

func (r *FileRef) Path() string

func (*FileRef) WriteTo

func (r *FileRef) WriteTo(w io.Writer) (int64, error)

type RawFile

type RawFile struct {
	FPath   string
	Content []byte
}

RawFile represents a file with its included `Content` in case the compiler needs to read/manipulate it. If the content is not needed except to `WriteTo`, then try using FileRef instead.

func (*RawFile) Clone

func (r *RawFile) Clone() File

func (*RawFile) Path

func (r *RawFile) Path() string

func (*RawFile) WriteTo

func (r *RawFile) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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