file

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	FilePath string

	Gzip bool
	Zip  bool

	URL       string
	Inline    string
	ZippedExt string
	// contains filtered or unexported fields
}

File managed file operation for kamino.

func (*File) Close

func (fi *File) Close()

Close the file if it is still opened.

func (*File) CloseFile

func (fi *File) CloseFile(log *logrus.Entry) error

CloseFile close the file and rename the temporary file to real name (if exists).

func (*File) OpenReadFile

func (fi *File) OpenReadFile(log *logrus.Entry) (io.ReadCloser, error)

OpenReadFile open and return a io.ReadCloser used by datasource, providers and template destination.

func (*File) OpenWriteFile

func (fi *File) OpenWriteFile(log *logrus.Entry) (io.WriteCloser, error)

OpenWriteFile open and return a io.WriteCloser corresponding to the datasource to be used by providers.

func (*File) ResetFile

func (fi *File) ResetFile(log *logrus.Entry) error

ResetFile close the file and remove the temporary file.

func (*File) Stat

func (fi *File) Stat() (os.FileInfo, error)

Stat returns os.FileInfo on the file of the datasource.

type StdinReaderCloser

type StdinReaderCloser struct {
	io.Reader
	io.Closer
}

StdinReaderCloser type for Stdin with a non closing Close operation to avoid multiple close.

func NewStdinReaderCloser

func NewStdinReaderCloser() *StdinReaderCloser

NewStdinReaderCloser return an new instance of StdinReaderCloser.

func (*StdinReaderCloser) Close

func (s *StdinReaderCloser) Close() error

Close fake the stream close.

func (*StdinReaderCloser) Read

func (s *StdinReaderCloser) Read(p []byte) (n int, err error)

Read read from Stdin.

type StdoutWriterCloser

type StdoutWriterCloser struct {
	io.Writer
	io.Closer
}

StdoutWriterCloser type for Stdout with a non closing Close operation to avoid multiple close.

func NewStdoutWriterCloser

func NewStdoutWriterCloser() *StdoutWriterCloser

NewStdoutWriterCloser return an new instance of StdoutWriterCloser.

func (*StdoutWriterCloser) Close

func (s *StdoutWriterCloser) Close() error

Close fake the stream close.

func (*StdoutWriterCloser) Write

func (s *StdoutWriterCloser) Write(p []byte) (n int, err error)

Write write to Stdout.

Jump to

Keyboard shortcuts

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