luna

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(parent, relative string) string

Combine creates a path from the parent combined with the relative path. The relative path is a file system path so should only contain forward slashes, not the standard file path separator as denoted by filepath.Separator, typically used when interacting with the local file system. Do not use trailing "/".

func ExistInFS

func ExistInFS(fs interface{}) types.GomegaMatcher

func IsLinkError

func IsLinkError(err error, reason string)

func Repo

func Repo(relative string) string

Repo gets the path of the repo with relative joined on

Types

type AsDirectory

type AsDirectory string

type AsFile

type AsFile string

type FileAdapter

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

func (*FileAdapter) Close

func (f *FileAdapter) Close() error

func (*FileAdapter) Read

func (f *FileAdapter) Read(p []byte) (n int, err error)

func (*FileAdapter) Stat

func (f *FileAdapter) Stat() (os.FileInfo, error)

func (*FileAdapter) Write

func (f *FileAdapter) Write(p []byte) (n int, err error)

type FileInfoAdapter

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

func (*FileInfoAdapter) IsDir

func (fi *FileInfoAdapter) IsDir() bool

func (*FileInfoAdapter) ModTime

func (fi *FileInfoAdapter) ModTime() time.Time

func (*FileInfoAdapter) Mode

func (fi *FileInfoAdapter) Mode() os.FileMode

func (*FileInfoAdapter) Name

func (fi *FileInfoAdapter) Name() string

func (*FileInfoAdapter) Size

func (fi *FileInfoAdapter) Size() int64

func (*FileInfoAdapter) Sys

func (fi *FileInfoAdapter) Sys() interface{}

type MemFS

type MemFS struct {
	fstest.MapFS
	// contains filtered or unexported fields
}

MemFS is a memory fs based on fstest.MapFS intended to be used in unit tests. Clients can embed and override the methods defined here without having to provide a full implementation from scratch.

func NewMemFS

func NewMemFS() *MemFS

func (*MemFS) Calc

func (f *MemFS) Calc() nef.PathCalc

func (*MemFS) Change

func (f *MemFS) Change(_, _ string) error

Change is not currently implemented on MemFS

func (*MemFS) Copy

func (f *MemFS) Copy(_, _ string) error

Copy is not currently implemented on MemFS

func (*MemFS) CopyFS

func (f *MemFS) CopyFS(_ string, _ fs.FS) error

func (*MemFS) Create

func (f *MemFS) Create(name string) (fs.File, error)

func (*MemFS) DirectoryExists

func (f *MemFS) DirectoryExists(name string) bool

func (*MemFS) Ensure

func (f *MemFS) Ensure(_ nef.PathAs) (string, error)

Ensure is not currently implemented on MemFS

func (*MemFS) FileExists

func (f *MemFS) FileExists(name string) bool

func (*MemFS) IsRelative added in v0.1.9

func (f *MemFS) IsRelative() bool

func (*MemFS) MakeDir

func (f *MemFS) MakeDir(name string, perm os.FileMode) error

func (*MemFS) MakeDirAll

func (f *MemFS) MakeDirAll(name string, perm os.FileMode) error

func (*MemFS) Move

func (f *MemFS) Move(_, _ string) error

Move is not currently implemented on MemFS

func (*MemFS) Remove

func (f *MemFS) Remove(name string) error

Remove removes the named file or (empty) directory. If there is an error, it will be of type *PathError.

func (*MemFS) RemoveAll

func (f *MemFS) RemoveAll(path string) error

func (*MemFS) Rename

func (f *MemFS) Rename(from, to string) error

func (*MemFS) WriteFile

func (f *MemFS) WriteFile(name string, data []byte, perm os.FileMode) error

type PathExistsMatcher

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

func (*PathExistsMatcher) FailureMessage

func (m *PathExistsMatcher) FailureMessage(actual interface{}) string

func (*PathExistsMatcher) Match

func (m *PathExistsMatcher) Match(actual interface{}) (bool, error)

func (*PathExistsMatcher) NegatedFailureMessage

func (m *PathExistsMatcher) NegatedFailureMessage(actual interface{}) string

Jump to

Keyboard shortcuts

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