Documentation
¶
Index ¶
- type Adapter
- type RealAdapter
- func (a *RealAdapter) EditFile(path string) ([]byte, error)
- func (a *RealAdapter) EditTempFile(content string, extension string) (string, error)
- func (a *RealAdapter) ReadFile(path string) ([]byte, error)
- func (a *RealAdapter) ViewWithPager(content string) error
- func (a *RealAdapter) WriteFile(path string, content []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface { // ReadFile reads the content of a file ReadFile(path string) ([]byte, error) // WriteFile writes content to a file WriteFile(path string, content []byte) error // EditFile opens a file in the user's editor and returns the edited content EditFile(path string) ([]byte, error) // EditTempFile creates a temporary file with content, opens it in editor, and returns edited content EditTempFile(content string, extension string) (string, error) // ViewWithPager displays content using a pager ViewWithPager(content string) error }
Adapter defines the interface for filesystem operations
type RealAdapter ¶
type RealAdapter struct{}
RealAdapter provides a real implementation of the filesystem adapter
func NewRealAdapter ¶
func NewRealAdapter() *RealAdapter
NewRealAdapter creates a new real filesystem adapter
func (*RealAdapter) EditFile ¶
func (a *RealAdapter) EditFile(path string) ([]byte, error)
EditFile implements the Adapter interface
func (*RealAdapter) EditTempFile ¶
func (a *RealAdapter) EditTempFile(content string, extension string) (string, error)
EditTempFile implements the Adapter interface
func (*RealAdapter) ReadFile ¶
func (a *RealAdapter) ReadFile(path string) ([]byte, error)
ReadFile implements the Adapter interface
func (*RealAdapter) ViewWithPager ¶
func (a *RealAdapter) ViewWithPager(content string) error
ViewWithPager implements the Adapter interface
Click to show internal directories.
Click to hide internal directories.