Help us shape the future of Go! Take the 2026 Go Developer Survey

github

package
v0.0.0-...-418b8b1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDescription

func BuildDescription(issue db.Issue, baseURL, projectID string, latestStacktrace string) string

BuildDescription creates a formatted description for a GitHub issue from a GoSnag issue.

func CheckAndCreateIssue

func CheckAndCreateIssue(ctx context.Context, queries *db.Queries, baseURL string, projectID uuid.UUID, issue db.Issue)

CheckAndCreateIssue evaluates GitHub rules for an issue and creates a GitHub issue if matched.

func MatchesRule

func MatchesRule(rule db.GithubRule, issue db.Issue, userCount int32, evalCtx *conditions.EvalContext) bool

MatchesRule checks whether an issue satisfies all conditions of a GitHub rule.

func TestConnection

func TestConnection(cfg Config) error

TestConnection verifies that the GitHub config is valid by fetching the repo.

Types

type Config

type Config struct {
	Token  string
	Owner  string
	Repo   string
	Labels string // comma-separated label names
}

Config holds GitHub connection settings from a project.

func ConfigFromSettings

func ConfigFromSettings(settings projectcfg.ProjectSettings) Config

func (Config) IsConfigured

func (c Config) IsConfigured() bool

IsConfigured returns true if the project has GitHub configured.

type CreateIssueResult

type CreateIssueResult struct {
	Number int    `json:"number"`
	URL    string `json:"html_url"`
}

CreateIssueResult holds the result of creating a GitHub issue.

func CreateIssue

func CreateIssue(cfg Config, title, body string) (*CreateIssueResult, error)

CreateIssue creates a new issue in GitHub.

type Handler

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

func NewHandler

func NewHandler(queries *db.Queries, cfg *config.Config) *Handler

func (*Handler) CreateIssueHandler

func (h *Handler) CreateIssueHandler(w http.ResponseWriter, r *http.Request)

CreateIssueHandler manually creates a GitHub issue from a GoSnag issue.

func (*Handler) CreateRule

func (h *Handler) CreateRule(w http.ResponseWriter, r *http.Request)

CreateRule creates a new GitHub auto-creation rule.

func (*Handler) DeleteRule

func (h *Handler) DeleteRule(w http.ResponseWriter, r *http.Request)

DeleteRule deletes a GitHub rule.

func (*Handler) ListRules

func (h *Handler) ListRules(w http.ResponseWriter, r *http.Request)

ListRules lists all GitHub rules for a project.

func (*Handler) TestConnection

func (h *Handler) TestConnection(w http.ResponseWriter, r *http.Request)

TestConnection tests the GitHub connection for a project.

func (*Handler) UpdateRule

func (h *Handler) UpdateRule(w http.ResponseWriter, r *http.Request)

UpdateRule updates a GitHub rule.

type RuleRequest

type RuleRequest struct {
	Name         string          `json:"name"`
	Enabled      bool            `json:"enabled"`
	LevelFilter  string          `json:"level_filter"`
	MinEvents    int32           `json:"min_events"`
	MinUsers     int32           `json:"min_users"`
	TitlePattern string          `json:"title_pattern"`
	Conditions   json.RawMessage `json:"conditions,omitempty"`
}

Jump to

Keyboard shortcuts

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