ports

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeReviewAI

type CodeReviewAI interface {
	// ReviewCodeDiff は完成されたプロンプトを基にAIにレビューを依頼します。
	ReviewCodeDiff(ctx context.Context, modelName, finalPrompt string) (string, error)
}

CodeReviewAI は、AIとの通信機能の抽象化を提供し、DIで使用されます。

type GitService

type GitService interface {
	// CloneOrUpdate はリポジトリをクローンまたは更新し、成功時に nil を返します。
	CloneOrUpdate(ctx context.Context, repositoryURL string) error
	// Fetch はリモートから最新の変更を取得します。
	Fetch(ctx context.Context) error
	// CheckRefExists は指定された参照(ブランチ、タグ、またはコミットハッシュ)が利用可能か確認します。
	CheckRefExists(ctx context.Context, ref string) (bool, error)
	// GetCodeDiff は指定された2つの参照間の純粋な差分を文字列として取得します。
	GetCodeDiff(ctx context.Context, base, head string) (string, error)
	// Cleanup は処理後にローカルリポジトリをクリーンな状態に戻します。
	Cleanup(ctx context.Context) error
}

GitService はGitリポジトリ操作の抽象化を提供します。

type MarkdownToHtmlRunner

type MarkdownToHtmlRunner interface {
	// Run は Markdown コンテンツをバイトスライスで受け取り、HTML コンテンツを含む io.Reader を返します。
	Run(markdownContent []byte) (io.Reader, error)
}

MarkdownToHtmlRunner は、Markdown コンテンツを完全な HTML ドキュメントに変換する契約です。

type PromptBuilder

type PromptBuilder interface {
	Build(mode string, data any) (string, error)
}

PromptBuilder は、プロンプト文字列を生成する責務を定義します。 data にはテンプレート内で評価可能な構造体またはマップを渡す必要があります。

type Publisher

type Publisher interface {
	Publish(ctx context.Context, uri string, data ReviewData) error
}

Publisher はレビューレポートを指定されたURIに公開する責務を定義します。

type ReviewData

type ReviewData struct {
	RepoURL        string
	BaseBranch     string
	FeatureBranch  string
	ReviewMarkdown string
}

ReviewData はレポート生成に必要なすべての情報をまとめた構造体です。

Jump to

Keyboard shortcuts

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