repofs

package
v0.0.0-...-7b96089 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: AGPL-3.0 Imports: 10 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 interface {
	fs.FS

	// IsDirty returns true if there are uncommitted changes.
	IsDirty() (bool, error)
	// GetStagedChanges returns a string containing the staged changes as a diff.
	GetStagedChanges() (string, error)
	// GetUncommittedChanges returns a string containing the uncommitted changes as a diff.
	GetUncommittedChanges() (string, error)
	// Checkout checks out the given commit.
	Checkout(commit string) error
	// Commit commits the changes with the given message.
	Commit(message string) (commitId string, err error)
	// Push pushes the changes to the remote repository.
	Push() error
	// StageAll stages all the changes.
	StageAll() error

	// Path returns the path to the repository.
	Path() string
}

func NewFS

func NewFS(repoPath string) (FS, error)

type FileHandle

type FileHandle interface {
	Get() (io.ReadCloser, error)
	Put(src io.Reader) error
	Close() error
}

func Bytes

func Bytes(content []byte) FileHandle

func String

func String(content string) FileHandle

type FsFileHandle

type FsFileHandle struct {
	FS   fs.FS
	Path string
}

func (FsFileHandle) Close

func (o FsFileHandle) Close() error

func (FsFileHandle) Get

func (o FsFileHandle) Get() (io.ReadCloser, error)

func (FsFileHandle) Put

func (o FsFileHandle) Put(src io.Reader) error

Jump to

Keyboard shortcuts

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