fs

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	*afero.Afero
	// contains filtered or unexported fields
}

func NewFS

func NewFS(path string, sync FSSync) *FS

func (*FS) ReadJSON

func (f *FS) ReadJSON(filename string, v interface{}) error

func (*FS) Sync

func (f *FS) Sync() ([]string, error)

func (*FS) WriteFile

func (f *FS) WriteFile(filename string, data []byte, message string) error

func (*FS) WriteJSON

func (f *FS) WriteJSON(filename string, data interface{}, msg string) error

type FSSync

type FSSync interface {
	Sync() (updated []string, err error)
	Persist(message, filename string) error
}

func NewGitSync

func NewGitSync(path string) FSSync

func NewPlaceboSync

func NewPlaceboSync() FSSync

type GitSync

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

func (*GitSync) Persist

func (g *GitSync) Persist(msg string, file string) error

func (*GitSync) Sync

func (g *GitSync) Sync() ([]string, error)

type PlaceboSync

type PlaceboSync struct{}

func (*PlaceboSync) Persist

func (g *PlaceboSync) Persist(msg string, file string) error

func (*PlaceboSync) Sync

func (g *PlaceboSync) Sync() ([]string, error)

Jump to

Keyboard shortcuts

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