provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

func (*FSProvider) Open

func (p *FSProvider) Open(path string) (string, error)

Open returns the content of a file

func (*FSProvider) ReadFile

func (p *FSProvider) ReadFile(path string) ([]byte, error)

ReadFile reads file content as bytes

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

func (*FakeProvider) Open

func (p *FakeProvider) Open(path string) (string, error)

Open returns the content of a file

func (*FakeProvider) ReadFile

func (p *FakeProvider) ReadFile(path string) ([]byte, error)

ReadFile reads file content as bytes

Jump to

Keyboard shortcuts

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