github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package github provides a client for interacting with the GitHub Notifications API. It wraps the go-github library and converts responses to application-specific models.

Package github provides a client for interacting with the GitHub Notifications API. It wraps the go-github library and converts responses to application-specific models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaysAgo

func DaysAgo(n int) *time.Time

DaysAgo returns a time.Time representing n days in the past from now. Useful for constructing the Since parameter in ListOptions.

Types

type Client

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

Client wraps the GitHub API client and provides notification-specific operations.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new GitHub API client using the GITHUB_TOKEN environment variable. Returns an error if the token is not set or authentication fails.

func (*Client) ListNotifications

func (c *Client) ListNotifications(
	ctx context.Context,
	opts ListOptions,
) ([]model.Notification, error)

ListNotifications retrieves all GitHub notifications matching the specified options. It automatically handles pagination to fetch all available notifications. Returns the notifications as application-specific model objects.

type ListOptions

type ListOptions struct {
	All           bool       // Include read notifications in the response
	Participating bool       // Only show notifications user is participating in
	Since         *time.Time // Only show notifications updated after this time
}

ListOptions specifies filters for retrieving GitHub notifications.

Jump to

Keyboard shortcuts

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