github

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogError added in v0.4.0

func LogError(logger logger.Logger, err error, operation string, context map[string]interface{})

LogError logs an error with structured context

Types

type APIError added in v0.4.0

type APIError struct {
	*errors.AppError
	StatusCode int
	RequestID  string
	Resource   string
	Operation  string
}

APIError represents a structured GitHub API error

func NewAPIError added in v0.4.0

func NewAPIError(message string, statusCode int, cause error) *APIError

func (*APIError) WithOperation added in v0.4.0

func (e *APIError) WithOperation(operation string) *APIError

func (*APIError) WithRequestID added in v0.4.0

func (e *APIError) WithRequestID(requestID string) *APIError

func (*APIError) WithResource added in v0.4.0

func (e *APIError) WithResource(resource string) *APIError

type Authenticator

type Authenticator interface {
	AuthTokenForHost(host string) (string, error)
}

type GitHubAuthenticator

type GitHubAuthenticator struct{}

func (*GitHubAuthenticator) AuthTokenForHost

func (ga *GitHubAuthenticator) AuthTokenForHost(host string) (string, error)

type RateLimitError added in v0.2.0

type RateLimitError struct {
	Err        error
	Limit      int
	Remaining  int
	ResetAt    time.Time
	RetryAfter time.Duration
	Resource   string
	Operation  string
}

Enhanced RateLimitError with more context

func NewRateLimitError added in v0.4.0

func NewRateLimitError(gitHubErr *github.RateLimitError, resource, operation string) *RateLimitError

NewRateLimitError creates a RateLimitError from github.RateLimitError

func (RateLimitError) Error added in v0.2.0

func (e RateLimitError) Error() string

func (RateLimitError) Unwrap added in v0.4.0

func (e RateLimitError) Unwrap() error

type WorkflowRunsConfig

type WorkflowRunsConfig struct {
	Org              string
	Repo             string
	WorkflowFileName string
	WorkflowID       int64
}

Legacy types for backward compatibility - use types package instead

func FromWorkflowConfig added in v0.4.0

func FromWorkflowConfig(config *types.WorkflowConfig) *WorkflowRunsConfig

FromWorkflowConfig creates legacy WorkflowRunsConfig from types.WorkflowConfig

func (*WorkflowRunsConfig) ToWorkflowConfig added in v0.4.0

func (c *WorkflowRunsConfig) ToWorkflowConfig() *types.WorkflowConfig

ToWorkflowConfig converts legacy WorkflowRunsConfig to types.WorkflowConfig

type WorkflowRunsOptions

type WorkflowRunsOptions struct {
	Actor               string
	Branch              string
	Event               string
	Status              string
	Created             string
	HeadSHA             string
	ExcludePullRequests bool
	CheckSuiteID        int64
	All                 bool
}

func FromAPIRequestOptions added in v0.4.0

func FromAPIRequestOptions(options *types.APIRequestOptions) *WorkflowRunsOptions

FromAPIRequestOptions creates legacy WorkflowRunsOptions from types.APIRequestOptions

func (*WorkflowRunsOptions) ToAPIRequestOptions added in v0.4.0

func (o *WorkflowRunsOptions) ToAPIRequestOptions() *types.APIRequestOptions

ToAPIRequestOptions converts legacy WorkflowRunsOptions to types.APIRequestOptions

type WorkflowStatsClient

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

func NewClient

func NewClient(host string, authenticator Authenticator, log logger.Logger) (*WorkflowStatsClient, error)

func (*WorkflowStatsClient) FetchWorkflowJobsAttempts

func (c *WorkflowStatsClient) FetchWorkflowJobsAttempts(ctx context.Context, runs []*github.WorkflowRun, cfg *WorkflowRunsConfig) ([]*github.WorkflowJob, error)

func (*WorkflowStatsClient) FetchWorkflowRuns

func (*WorkflowStatsClient) WithLogger added in v0.4.0

WithLogger returns a new client with the specified logger

Jump to

Keyboard shortcuts

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