stars

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity interface {
	ListStargazers(ctx context.Context, owner string, repo string, opts *github.ListOptions) ([]*github.Stargazer, *github.Response, error)
}

type Client

type Client struct {
	Repositories
	Activity
}

func New

func New(client *github.Client) *Client

func (Client) GetStarGazers

func (c Client) GetStarGazers(ctx context.Context, user string, repo string) iter.Seq2[*github.Stargazer, error]

func (Client) GetUserRepoNames

func (c Client) GetUserRepoNames(ctx context.Context, user string) iter.Seq2[*github.Repository, error]

type Notifier

type Notifier interface {
	Notify(repository *github.Repository, gazers []*github.Stargazer)
}

type Notifiers

type Notifiers []Notifier

func (Notifiers) Notify

func (n Notifiers) Notify(repository *github.Repository, gazers []*github.Stargazer)

type Processor

type Processor struct {
	User       string
	Repository *github.Repository
	Interval   time.Duration
	Client     *Client
	Store      *Store
	Notifier   Notifier
	Logger     *slog.Logger
}

func (*Processor) Run

func (p *Processor) Run(ctx context.Context)

type RepoScanner

type RepoScanner struct {
	User         string
	RepoInterval time.Duration
	StarInterval time.Duration
	Logger       *slog.Logger
	Client       *Client
	Store        *Store
	Notifier     Notifier

	IncludeArchived bool
	// contains filtered or unexported fields
}

func (*RepoScanner) Run

func (r *RepoScanner) Run(ctx context.Context) error

type Repositories

type Repositories interface {
	ListByUser(ctx context.Context, user string, opts *github.RepositoryListByUserOptions) ([]*github.Repository, *github.Response, error)
}

type SLogNotifier

type SLogNotifier struct {
	Logger *slog.Logger
}

func (SLogNotifier) Notify

func (s SLogNotifier) Notify(repository *github.Repository, gazers []*github.Stargazer)

type SlackWebHookNotifier

type SlackWebHookNotifier struct {
	WebHookURL string
	Logger     *slog.Logger
}

func (*SlackWebHookNotifier) Notify

func (s *SlackWebHookNotifier) Notify(repository *github.Repository, gazers []*github.Stargazer)

type Store

type Store struct {
	DatabasePath string
	Repos        map[string]repository
	// contains filtered or unexported fields
}

func (*Store) Add

func (s *Store) Add(repo *github.Repository, newStargazer *github.Stargazer) (bool, error)

func (*Store) Len

func (s *Store) Len() int

func (*Store) Load

func (s *Store) Load() error

func (*Store) Save

func (s *Store) Save() error

Jump to

Keyboard shortcuts

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