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

githubkit

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQuery

func BuildQuery(t DorkTemplate, org, domain string) string

BuildQuery substitutes {org} and {domain} placeholders.

func Classify

func Classify(fragments []string) string

Classify returns the most specific secret type found in the fragments.

func NewCapability

func NewCapability(deps core.Deps) (core.Capability, error)

func SearchURL

func SearchURL(base, query string, page, perPage int) string

SearchURL is a helper for host UIs/tests.

Types

type Client

type Client struct {
	Fetcher  core.Fetcher
	Settings core.Settings
	Limiter  core.Limiter
	BaseURL  string
	ProxyURL string
}

Client runs GitHub Code Search through the external Fetcher port.

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string, page, perPage int) (*SearchResult, error)

type Credibility

type Credibility struct {
	Score int    `json:"score"`
	Level string `json:"level"` // high | medium | low
}

Credibility is a lightweight static score for a code-search hit. It only produces a hint; the host/agent must validate before reporting.

func ScoreCredibility

func ScoreCredibility(repo string, stars int, fork bool, path string) Credibility

type DorkTemplate

type DorkTemplate struct {
	ID       string `json:"id"`
	Category string `json:"category"`
	Title    string `json:"title"`
	Query    string `json:"query"`
	Note     string `json:"note,omitempty"`
}

DorkTemplate is one reusable GitHub code-search query.

func TemplateByID

func TemplateByID(id string) (DorkTemplate, bool)

TemplateByID returns one template by ID.

func Templates

func Templates() []DorkTemplate

Templates returns a copy of the built-in dork library.

type Kit

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

Kit exposes GitHub Code Search for leaked secrets. It uses the external Fetcher port (not target-scoped HTTP) and the host's GitHub token setting.

func New

func New(deps core.Deps) *Kit

func (*Kit) Call

func (k *Kit) Call(ctx context.Context, call core.Call) (core.Result, error)

Call is the envelope shell: every return path from dispatch is normalized so Status/OK/Meta and a clamped Summary hold on success and failure alike.

func (*Kit) Manifest

func (k *Kit) Manifest() core.Manifest

func (*Kit) SetProxyURL

func (k *Kit) SetProxyURL(proxy string)

SetProxyURL sets the egress proxy for GitHub API requests.

type SearchItem

type SearchItem struct {
	Repo        string      `json:"repo"`
	RepoURL     string      `json:"repo_url"`
	Path        string      `json:"path"`
	FileURL     string      `json:"file_url"`
	Stars       int         `json:"stars"`
	Fork        bool        `json:"fork"`
	OwnerLogin  string      `json:"owner_login,omitempty"`
	PushedAt    string      `json:"pushed_at,omitempty"`
	Fragments   []string    `json:"fragments,omitempty"`
	SecretType  string      `json:"secret_type"`
	Credibility Credibility `json:"credibility"`
}

type SearchResult

type SearchResult struct {
	TotalCount int          `json:"total_count"`
	Incomplete bool         `json:"incomplete"`
	Items      []SearchItem `json:"items"`
	Query      string       `json:"query"`
	Page       int          `json:"page"`
	PerPage    int          `json:"per_page"`
	Truncated  bool         `json:"truncated"`
}

Jump to

Keyboard shortcuts

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