commitclient

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: MIT Package commitclient selects the provider client for a resolved commit query.

SPDX-License-Identifier: MIT

SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityClient added in v1.1.0

type ActivityClient interface {
	CollectActivity(context.Context, model.ActivityQuery) (model.ActivityResult, error)
}

ActivityClient gathers a repository's activity over a window. It is a separate interface from Client because only GitHub implements it: a GitLab activity path is not stubbed out, since config.ResolveActivity rejects non-GitHub providers before a client is ever constructed.

func NewActivity added in v1.1.0

func NewActivity(cfg config.Config, q model.ActivityQuery, opts ...Option) (ActivityClient, error)

NewActivity builds the GitHub client for a repository-activity query, wiring in the request budget so every provider call is accounted and bounded.

It takes no provider argument: repository activity is GitHub-only, and the rejection lives in config.ResolveActivity so the failure is identical whether the request came from the CLI or from MCP, and is unreachable with a half-built client behind it.

type Client

type Client interface {
	Collect(context.Context, model.Query) (model.Result, error)
}

Client is the common behavior shared by provider-specific commit clients.

func New

func New(cfg config.Config, q model.Query, opts ...Option) (Client, error)

New builds the provider client for a resolved query. q.Provider is expected to be an already-resolved, non-empty value: config.Resolve applies the empty->default->github fallback and rejects invalid providers, so New does not repeat that defaulting. The switch's default branch is kept as a guard so the exported constructor never returns a nil client for an unexpected value.

It takes the whole query rather than just the provider so the per-call request ceiling reaches the client; a ceiling resolved into the query but never handed to the transport would be silently ignored.

type Option added in v1.3.0

type Option func(*options)

Option configures a client constructor.

func WithCredentialReport added in v1.3.0

func WithCredentialReport(w io.Writer) Option

WithCredentialReport makes the constructor write one line naming the credential source it selected (never the credential itself) to w. A nil w keeps the constructor silent, so callers can pass their verbosity-gated writer unconditionally.

type PRClient added in v1.2.0

type PRClient interface {
	CollectPRs(context.Context, model.PRQuery) (model.PRResult, error)
	CollectPRInbox(context.Context, model.PRInboxQuery) (model.PRInboxResult, error)
}

PRClient is the implemented PR collection surface used by application adapters.

func NewPR added in v1.2.0

func NewPR(cfg config.Config, opts ...Option) (PRClient, error)

NewPR selects sting's dedicated GitHub credential and preserves the API host. Each public collection call establishes its own query-authoritative budget.

Jump to

Keyboard shortcuts

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