infrastructure

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepoNotFound = errors.New("could not find git repository")

Functions

func FindRepoRootFrom

func FindRepoRootFrom(cwd ports.CWD) (string, error)

func NewGitRepositoryFromPath

func NewGitRepositoryFromPath(from ports.CWD) (*GitRepository, *ReadWriteDirFS, error)

Types

type GitRepository

type GitRepository struct {
	RepoFS     fs.FS
	Repository *git.Repository
	Worktree   *git.Worktree
}

func NewGitRepository

func NewGitRepository(repoFS fs.FS, repository *git.Repository) (*GitRepository, error)

func (GitRepository) Commit

func (g GitRepository) Commit(message string) error

func (GitRepository) IsStagingDirty

func (g GitRepository) IsStagingDirty() (bool, error)

func (GitRepository) OpenObjectAtHead

func (g GitRepository) OpenObjectAtHead(filePath string) (*object.File, error)

func (GitRepository) StageFile

func (g GitRepository) StageFile(path string) error

func (GitRepository) WalkAgeFiles

func (g GitRepository) WalkAgeFiles(onMatch fs.WalkDirFunc) error

type Identities

type Identities struct {
	IdentitiesFile string
}

func NewIdentities

func NewIdentities(identitiesFile string) *Identities

func (Identities) All

func (i Identities) All() ([]age.Identity, error)

func (Identities) Generate

func (i Identities) Generate(comment string) (pubKey string, err error)

type ReadWriteDirFS

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

func NewReadWriteDirFS

func NewReadWriteDirFS(rootPath string) *ReadWriteDirFS

func (ReadWriteDirFS) Create added in v0.1.7

func (f ReadWriteDirFS) Create(filePath string, opts ...ports.OpenRWOptions) (ports.ReadWriteFile, error)

func (ReadWriteDirFS) Mkdir

func (f ReadWriteDirFS) Mkdir(dir string, all bool, mode os.FileMode) error

func (ReadWriteDirFS) Open

func (f ReadWriteDirFS) Open(name string) (fs.File, error)

func (ReadWriteDirFS) ReadDir

func (f ReadWriteDirFS) ReadDir(name string) ([]fs.DirEntry, error)

func (ReadWriteDirFS) Remove

func (f ReadWriteDirFS) Remove(filePath string) error

func (ReadWriteDirFS) Rename

func (f ReadWriteDirFS) Rename(oldPath, newPath string) error

func (ReadWriteDirFS) TempFile

func (f ReadWriteDirFS) TempFile(dir, pattern string) (ports.ReadWriteFile, error)

type RecipientsFile

type RecipientsFile struct {
	FS ports.ReadWriteFS
}

func NewRecipientsFile

func NewRecipientsFile(fs ports.ReadWriteFS) *RecipientsFile

func (RecipientsFile) All

func (r RecipientsFile) All() ([]age.Recipient, error)

func (RecipientsFile) Append

func (r RecipientsFile) Append(pubKey string, comment string) (recipients []age.Recipient, err error)

Jump to

Keyboard shortcuts

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