github

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(token string) *Client

func (*Client) AddLabelsToIssue

func (c *Client) AddLabelsToIssue(ctx context.Context, owner, repo string, issueNumber int, labels []string) error

AddLabelsToIssue adds the specified labels to an issue

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(ctx context.Context, owner, repo string, issueNumber int, comment string) error

func (*Client) GetLabelsForAIAnalysis

func (c *Client) GetLabelsForAIAnalysis(ctx context.Context, owner, repo string) (string, []*github.Label, error)

GetLabelsForAIAnalysis returns formatted label information for AI analysis

func (*Client) GetRepositoryContent

func (c *Client) GetRepositoryContent(ctx context.Context, owner, repo string) ([]GitHubFile, error)

func (*Client) GetRepositoryLabels

func (c *Client) GetRepositoryLabels(ctx context.Context, owner, repo string) ([]*github.Label, error)

GetRepositoryLabels returns all labels in the repository

func (*Client) WithFileFilter

func (c *Client) WithFileFilter(filter FileFilter) *Client

type FileFilter

type FileFilter struct {
	// AllowedExtensions is a list of file extensions to include (e.g. ".go", ".md")
	AllowedExtensions []string
	// AllowedFiles is a list of specific files to include without extensions (e.g. "Dockerfile", "Makefile")
	AllowedFiles []string
	// ExcludedPaths contains path patterns to exclude (e.g. "vendor/", "test/")
	ExcludedPaths []string
	// ExcludedFiles contains specific file patterns to exclude (e.g. "*_test.go")
	ExcludedFiles []string
}

FileFilter represents the configuration for file filtering

func DefaultFileFilter

func DefaultFileFilter() FileFilter

DefaultFileFilter returns the default file filter configuration

type GitHubFile

type GitHubFile struct {
	Path    string
	Content string
}

type LabelAnalysis

type LabelAnalysis struct {
	// SuggestedLabels is a map of label names to confidence scores (0.0-1.0)
	SuggestedLabels map[string]float64
	// Explanation provides reasoning for each suggested label
	Explanation string
}

LabelAnalysis represents the result of analyzing an issue for label suggestions

Jump to

Keyboard shortcuts

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