filesystem

package
v0.0.0-...-1a94de1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filesystem

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

func (*Filesystem) FileExists

func (f *Filesystem) FileExists(path string) bool

FileExists returns true if the file exists and is not a directory.

func (*Filesystem) Image

func (f *Filesystem) Image(path string) ([]byte, string, error)

func (*Filesystem) Read

func (f *Filesystem) Read(path string) ([]byte, error)

Read returns the content of the file. If the file does not exist, no error is returned.

func (*Filesystem) Sources

func (f *Filesystem) Sources(extensions []string) ([]string, error)

Sources expects the extension with a dot: [".md"].

func (*Filesystem) Write

func (f *Filesystem) Write(path, content string) error

type Interface

type Interface interface {
	FileExists(path string) bool
	Read(path string) ([]byte, error)
	Write(path, content string) error
	Image(path string) ([]byte, string, error)
	Sources(extensions []string) ([]string, error)
}

func New

func New(workspace string) Interface

Jump to

Keyboard shortcuts

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