Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCache ¶
type ClientCache struct {
// contains filtered or unexported fields
}
ClientCache manages GitHub clients for multiple org/repo combinations.
func NewClientCache ¶
func NewClientCache(tokenSourceFunc TokenSourceFunc) *ClientCache
NewClientCache creates a new client cache with the provided token source function.
type Option ¶
type Option func(*Reconciler)
Option configures a Reconciler.
func WithReconciler ¶
func WithReconciler(f ReconcilerFunc) Option
WithReconciler sets the reconciler function for all resource types.
func WithStateManager ¶
func WithStateManager(sm *StateManager) Option
WithStateManager sets a custom state manager.
type Reconciler ¶
type Reconciler struct {
workqueue.UnimplementedWorkqueueServiceServer
// contains filtered or unexported fields
}
Reconciler manages the reconciliation of GitHub resources.
func NewReconciler ¶
func NewReconciler(cc *ClientCache, opts ...Option) *Reconciler
NewReconciler creates a new Reconciler with the given options.
func (*Reconciler) GetStateManager ¶
func (r *Reconciler) GetStateManager() *StateManager
GetStateManager returns the state manager for accessing state operations.
func (*Reconciler) Process ¶ added in v0.6.196
func (r *Reconciler) Process(ctx context.Context, req *workqueue.ProcessRequest) (*workqueue.ProcessResponse, error)
Process implements the WorkqueueService.Process RPC.
type ReconcilerFunc ¶
ReconcilerFunc is the function signature for GitHub resource reconcilers. It receives the parsed resource information and appropriate GitHub client, and returns an error if reconciliation fails.
type Resource ¶
type Resource struct {
// Owner is the GitHub organization or user.
Owner string
// Repo is the repository name.
Repo string
// Number is the issue or pull request number.
Number int
// Type indicates whether this is an issue or pull request.
Type ResourceType
// URL is the original URL that was parsed.
URL string
}
Resource represents a parsed GitHub resource (issue or pull request).
type ResourceType ¶
type ResourceType string
ResourceType represents the type of GitHub resource.
const ( // ResourceTypeIssue represents a GitHub issue. ResourceTypeIssue ResourceType = "issue" // ResourceTypePullRequest represents a GitHub pull request. ResourceTypePullRequest ResourceType = "pull_request" )
type State ¶
type State[T any] struct { // contains filtered or unexported fields }
State wraps a typed state with resource information.
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
StateManager manages reconciler state stored in GitHub comments.
func NewStateManager ¶
func NewStateManager(identity string) *StateManager
NewStateManager creates a new state manager with the given identity. The identity is used to identify comments created by this reconciler.
func (*StateManager) Identity ¶
func (sm *StateManager) Identity() string
Identity returns the identity used by this state manager.
type TokenSourceFunc ¶
TokenSourceFunc is a function that creates an OAuth2 token source for a given org/repo.