io

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: MIT Imports: 6 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 interface {
	Create() error
	Exists() bool
	Path() string
	IsEqualTo(file File) bool
	AsBytes() ([]byte, error)
	Write(data []byte) error
}

File interface

func NewFileByAbsolutePath

func NewFileByAbsolutePath(path string) File

NewFileByAbsolutePath creates a new file by path

func NewFileByPath

func NewFileByPath(path string) File

NewFileByPath creates a new file by path

type FileByPath

type FileByPath struct {
	// contains filtered or unexported fields
}

FileByPath implementing File interface

func (*FileByPath) AsBytes

func (f *FileByPath) AsBytes() ([]byte, error)

AsBytes from file

func (*FileByPath) Create

func (f *FileByPath) Create() error

Create empty file if it does not exist

func (*FileByPath) Exists

func (f *FileByPath) Exists() bool

Exists whether or not the file exists

func (*FileByPath) IsEqualTo

func (f *FileByPath) IsEqualTo(file File) bool

IsEqualTo compares the file

func (*FileByPath) Path

func (f *FileByPath) Path() string

Path gets the path to the file

func (*FileByPath) Write

func (f *FileByPath) Write(data []byte) error

Jump to

Keyboard shortcuts

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