infrastructure

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 28 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 IdentitiesStore added in v0.2.0

func IdentitiesStore(ctx context.Context, sources ...identityStoreSource) (ports.IdentitiesStore, error)

func NewGitRepositoryFromPath

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

Types

type AgentIdentitiesStore added in v0.2.0

type AgentIdentitiesStore struct {
	IdentitiesClient agentv1connect.IdentitiesStoreServiceClient
}

func (AgentIdentitiesStore) Generate added in v0.2.0

func (a AgentIdentitiesStore) Generate(
	ctx context.Context,
	cmd dto.GenerateIdentityCommand,
) (publicKey string, err error)

func (AgentIdentitiesStore) Identities added in v0.2.0

func (a AgentIdentitiesStore) Identities(ctx context.Context, query dto.IdentitiesQuery) ([]age.Identity, error)

type AgentIdentitiesStoreSource added in v0.2.0

type AgentIdentitiesStoreSource struct {
	BaseUrl string
	Client  connect.HTTPClient
}

func NewAgentIdentitiesStoreSource added in v0.2.0

func NewAgentIdentitiesStoreSource() *AgentIdentitiesStoreSource

func (*AgentIdentitiesStoreSource) GetStore added in v0.2.0

func (*AgentIdentitiesStoreSource) IsValid added in v0.2.0

type FileIdentityStore added in v0.2.0

type FileIdentityStore url.URL

func (*FileIdentityStore) Generate added in v0.2.0

func (f *FileIdentityStore) Generate(_ context.Context, cmd dto.GenerateIdentityCommand) (publicKey string, err error)

func (*FileIdentityStore) Identities added in v0.2.0

type FileIdentityStoreSource added in v0.2.0

type FileIdentityStoreSource url.URL

func NewFileIdentityStoreSource added in v0.2.0

func NewFileIdentityStoreSource(url *url.URL) *FileIdentityStoreSource

func (*FileIdentityStoreSource) GetStore added in v0.2.0

func (*FileIdentityStoreSource) IsValid added in v0.2.0

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) Remotes added in v0.2.0

func (g GitRepository) Remotes() ([]string, error)

func (GitRepository) StageFile

func (g GitRepository) StageFile(path string) error

func (GitRepository) WalkAgeFiles

func (g GitRepository) WalkAgeFiles(onMatch fs.WalkDirFunc) 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