api

package
v0.0.0-...-4c5e68c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEmail         = errors.New("invalid email")
	ErrInvalidRepository    = errors.New("invalid repository")
	ErrInvalidToken         = errors.New("invalid token")
	ErrRepositoryNotFound   = errors.New("repository not found")
	ErrSubscriptionConflict = errors.New("subscription conflict")
	ErrTokenNotFound        = errors.New("token not found")
)

Functions

This section is empty.

Types

type ConfirmationSender

type ConfirmationSender interface {
	SendConfirmation(ctx context.Context, email notifier.ConfirmationEmail) error
}

type GitHubRepositoryChecker

type GitHubRepositoryChecker interface {
	RepositoryExists(ctx context.Context, owner, repo string) (bool, error)
}

type SubscriptionRepository

type SubscriptionRepository interface {
	Create(ctx context.Context, subscription *repository.Subscription) (repository.Subscription, error)
	ExistsActiveOrPending(ctx context.Context, email, repository string) (bool, error)
	FindByConfirmToken(ctx context.Context, token string) (repository.Subscription, error)
	FindByUnsubscribeToken(ctx context.Context, token string) (repository.Subscription, error)
	ListActiveByEmail(ctx context.Context, email string) ([]repository.Subscription, error)
	UpdateStatus(ctx context.Context, id int64, status app.SubscriptionStatus) error
}

type SubscriptionService

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

func NewSubscriptionService

func NewSubscriptionService(
	subscriptions SubscriptionRepository,
	githubChecker GitHubRepositoryChecker,
	confirmationSender ConfirmationSender,
	log *slog.Logger,
	confirmURLBase string,
) *SubscriptionService

func (*SubscriptionService) Confirm

func (s *SubscriptionService) Confirm(ctx context.Context, token string) error

func (*SubscriptionService) ListByEmail

func (s *SubscriptionService) ListByEmail(ctx context.Context, email string) ([]app.Subscription, error)

func (*SubscriptionService) Subscribe

func (s *SubscriptionService) Subscribe(ctx context.Context, email, ownerRepo string) error

func (*SubscriptionService) Unsubscribe

func (s *SubscriptionService) Unsubscribe(ctx context.Context, token string) error

Directories

Path Synopsis
Package restapi GitHub Release Notification API
Package restapi GitHub Release Notification API

Jump to

Keyboard shortcuts

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