Documentation
¶
Index ¶
- type FSProvider
- func (p *FSProvider) Exists(path string) (bool, error)
- func (p *FSProvider) GetBasePath() string
- func (p *FSProvider) IsDir(path string) (bool, error)
- func (p *FSProvider) ListDir(path string) ([]types.File, error)
- func (p *FSProvider) Open(path string) (string, error)
- func (p *FSProvider) ReadFile(path string) ([]byte, error)
- type FakeProvider
- func (p *FakeProvider) AddDir(path string)
- func (p *FakeProvider) AddFile(path, content string)
- func (p *FakeProvider) Exists(path string) (bool, error)
- func (p *FakeProvider) IsDir(path string) (bool, error)
- func (p *FakeProvider) ListDir(path string) ([]types.File, error)
- func (p *FakeProvider) Open(path string) (string, error)
- func (p *FakeProvider) ReadFile(path string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSProvider ¶
type FSProvider struct {
// contains filtered or unexported fields
}
FSProvider implements the Provider interface for local file systems
func NewFSProvider ¶
func NewFSProvider(rootPath string) *FSProvider
NewFSProvider creates a new file system provider
func (*FSProvider) Exists ¶
func (p *FSProvider) Exists(path string) (bool, error)
Exists checks if a file or directory exists
func (*FSProvider) GetBasePath ¶
func (p *FSProvider) GetBasePath() string
GetBasePath returns the base path for this provider
func (*FSProvider) IsDir ¶
func (p *FSProvider) IsDir(path string) (bool, error)
IsDir checks if a path is a directory
func (*FSProvider) ListDir ¶
func (p *FSProvider) ListDir(path string) ([]types.File, error)
ListDir returns the contents of a directory
type FakeProvider ¶
type FakeProvider struct {
// contains filtered or unexported fields
}
FakeProvider implements the Provider interface for testing
func NewFakeProvider ¶
func NewFakeProvider() *FakeProvider
NewFakeProvider creates a new fake provider
func (*FakeProvider) AddDir ¶
func (p *FakeProvider) AddDir(path string)
AddDir adds a directory to the fake provider
func (*FakeProvider) AddFile ¶
func (p *FakeProvider) AddFile(path, content string)
AddFile adds a file to the fake provider
func (*FakeProvider) Exists ¶
func (p *FakeProvider) Exists(path string) (bool, error)
Exists checks if a file or directory exists
func (*FakeProvider) IsDir ¶
func (p *FakeProvider) IsDir(path string) (bool, error)
IsDir checks if a path is a directory
func (*FakeProvider) ListDir ¶
func (p *FakeProvider) ListDir(path string) ([]types.File, error)
ListDir returns the contents of a directory
Click to show internal directories.
Click to hide internal directories.