Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSubscriptionNotFound may be returned when job is not found. ErrSubscriptionNotFound = errors.New("subscription not found") // ErrAlreadySubscribed may be returned if link is already subscribed. ErrAlreadySubscribed = errors.New("link already subscribed") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface { Subscribe(userID int, link string, payload func(*beta.Beta)) error Unsubscribe(userID int, link string) error GetUserSubscriptions(userID int) ([]Subscription, error) io.Closer }
Service describes subscription service. It will be periodically do payload.
func NewService ¶
func NewService(repo repository.Repository, interval time.Duration) Service
NewService new Service instance.
type Subscription ¶
type Subscription struct {
repository.Subscription
}
Subscription describes user subscription.
Click to show internal directories.
Click to hide internal directories.