io

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToTempFile

func CopyToTempFile(src io.Reader) (*os.File, error)

func CreateFileIfNotExist

func CreateFileIfNotExist(f string) (*os.File, error)

func GetOrgSpace

func GetOrgSpace(path string) (string, string)

func Tar

func Tar(src string, writers ...io.Writer) error

func Untar

func Untar(dst string, r io.Reader) error

Types

type FileDescriptor

type FileDescriptor struct {
	BaseDir   string
	Name      string
	Extension string
	Org       string
	Space     string
}

func NewFileDescriptor

func NewFileDescriptor(path string) (FileDescriptor, error)

type FileSystemHelper

type FileSystemHelper struct{}

func NewFileSystemHelper

func NewFileSystemHelper() FileSystemHelper

func (FileSystemHelper) Create

func (h FileSystemHelper) Create(name string) (*os.File, error)

func (FileSystemHelper) Exists

func (h FileSystemHelper) Exists(path string) (bool, error)

func (FileSystemHelper) IsEmpty

func (h FileSystemHelper) IsEmpty(name string) (bool, error)

func (FileSystemHelper) Mkdir

func (h FileSystemHelper) Mkdir(dir string) error

func (FileSystemHelper) Open

func (h FileSystemHelper) Open(name string) (*os.File, error)

func (FileSystemHelper) Rename

func (h FileSystemHelper) Rename(re *regexp.Regexp, dir string, newName string) error

func (FileSystemHelper) Tar

func (h FileSystemHelper) Tar(src string, writers ...io.Writer) error

func (FileSystemHelper) Untar

func (h FileSystemHelper) Untar(dst string, r io.Reader) error

type FileSystemOperations

type FileSystemOperations interface {
	Mkdir(dir string) error
	IsEmpty(name string) (bool, error)
	Exists(path string) (bool, error)
	Open(name string) (*os.File, error)
	Create(name string) (*os.File, error)
	Tar(src string, writers ...io.Writer) error
	Untar(dst string, r io.Reader) error
	Rename(re *regexp.Regexp, dir string, newName string) error
}

type InvalidFileExtensionError

type InvalidFileExtensionError struct {
	Ext string
}

func (*InvalidFileExtensionError) Error

func (e *InvalidFileExtensionError) Error() string

type Parser

type Parser struct {
}

func NewParser

func NewParser() *Parser

func (*Parser) Marshal

func (p *Parser) Marshal(in interface{}, fd FileDescriptor) error

func (*Parser) Unmarshal

func (p *Parser) Unmarshal(out interface{}, fd FileDescriptor) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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