commitclient

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

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

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) (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) (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.

Jump to

Keyboard shortcuts

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