fileutil

package
v0.14.9-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileHasID = errors.New("file already has ID")

Functions

func IsFilePath

func IsFilePath(path string) bool

func IsFilePathToRelativeDir

func IsFilePathToRelativeDir(path, dir string) bool

func LooksLikeFilePath

func LooksLikeFilePath(path string) bool

func LooksLikeRelativeFilePath

func LooksLikeRelativeFilePath(path string) bool

func RelativeTo

func RelativeTo(path, relativeTo string) string

func ToAbsDir

func ToAbsDir(filePath string) (string, error)

Types

type File

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

func New

func New(path string, b []byte) File

func Read

func Read(filePath string) (File, error)

func (File) AbsDir

func (f File) AbsDir() string

func (File) AbsPath

func (f File) AbsPath() string

func (File) Contents

func (f File) Contents() []byte

func (File) HasID

func (f File) HasID() bool

func (File) Reader

func (f File) Reader() io.Reader

func (File) RelativeFile

func (f File) RelativeFile(path string) string

func (File) SetID

func (f File) SetID(id string) (File, error)

func (File) Type

func (f File) Type() string

func (File) Write

func (f File) Write() (File, error)

Jump to

Keyboard shortcuts

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