Documentation
¶
Index ¶
- func ApplySort(deliveries []Delivery, sortBy string, ascending bool)
- func SortDeliveriesByEvent(deliveries []Delivery, ascending bool)
- func SortDeliveriesByRepository(deliveries []Delivery, ascending bool)
- func SortDeliveriesByStatusCode(deliveries []Delivery, ascending bool)
- func SortDeliveriesByTime(deliveries []Delivery, ascending bool)
- type Client
- func (c *Client) GetOrgHookDeliveryDetail(org string, hookID int, deliveryID int) (*DeliveryDetail, error)
- func (c *Client) GetRepoHookDeliveryDetail(repo string, hookID int, deliveryID int) (*DeliveryDetail, error)
- func (c *Client) ListOrgHookDeliveries(org string, hookID int, perPage int) ([]Delivery, error)
- func (c *Client) ListOrgRepos(org string) ([]string, error)
- func (c *Client) ListOrgWebhooks(org string) ([]Hook, error)
- func (c *Client) ListRepoHookDeliveries(repo string, hookID int, perPage int) ([]Delivery, error)
- func (c *Client) ListRepoWebhooks(repo string) ([]Hook, error)
- type Delivery
- type DeliveryDetail
- type Hook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortDeliveriesByEvent ¶
SortDeliveriesByEvent sorts deliveries alphabetically by event type
func SortDeliveriesByRepository ¶
SortDeliveriesByRepository sorts deliveries alphabetically by repository name
func SortDeliveriesByStatusCode ¶
SortDeliveriesByStatusCode sorts deliveries numerically by HTTP status code
func SortDeliveriesByTime ¶
SortDeliveriesByTime sorts deliveries by timestamp ascending=true sorts oldest first, ascending=false sorts newest first
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub API client
func NewClient ¶
NewClient creates a new GitHub API client Uses gh CLI's authentication automatically
func (*Client) GetOrgHookDeliveryDetail ¶
func (c *Client) GetOrgHookDeliveryDetail(org string, hookID int, deliveryID int) (*DeliveryDetail, error)
GetOrgHookDeliveryDetail retrieves detailed information for a specific delivery
func (*Client) GetRepoHookDeliveryDetail ¶
func (c *Client) GetRepoHookDeliveryDetail(repo string, hookID int, deliveryID int) (*DeliveryDetail, error)
GetRepoHookDeliveryDetail retrieves detailed information for a specific delivery
func (*Client) ListOrgHookDeliveries ¶
ListOrgHookDeliveries retrieves all deliveries for an organization hook
func (*Client) ListOrgRepos ¶
ListOrgRepos retrieves all repositories for an organization
func (*Client) ListOrgWebhooks ¶
ListOrgWebhooks retrieves all webhooks for an organization
func (*Client) ListRepoHookDeliveries ¶
ListRepoHookDeliveries retrieves all deliveries for a repository hook
type Delivery ¶
type Delivery struct {
ID int `json:"id"`
GUID string `json:"guid"`
DeliveredAt time.Time `json:"delivered_at"`
Redelivery bool `json:"redelivery"`
Duration float64 `json:"duration"`
Status string `json:"status"`
StatusCode int `json:"status_code"`
Event string `json:"event"`
Action string `json:"action"`
URL string `json:"url,omitempty"` // Only available in detailed view
Repository string `json:"-"` // Added by us to track which repo
HookID int `json:"-"` // Added by us to track which hook
}
Delivery represents a webhook delivery
type DeliveryDetail ¶
type DeliveryDetail struct {
Delivery
Request struct {
Headers map[string]string `json:"headers"`
Payload interface{} `json:"payload"`
} `json:"request"`
Response struct {
Headers map[string]string `json:"headers"`
Payload string `json:"payload"`
} `json:"response"`
}
DeliveryDetail represents a detailed webhook delivery with full information
type Hook ¶
type Hook struct {
ID int `json:"id"`
URL string `json:"url"`
Active bool `json:"active"`
Config struct {
URL string `json:"url"`
} `json:"config"`
}
Hook represents a GitHub webhook
func (*Hook) GetTargetURL ¶
GetWebhookTargetURL extracts the target URL from a webhook
func (*Hook) MatchesFilter ¶
MatchesFilter checks if the webhook's target URL matches the filter pattern