Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddExecutor ¶
type AddExecutor interface {
Execute() error
}
func NewAddExecutor ¶
func NewAddExecutor(database SubscriptionWriter, subscription models.Subscription) AddExecutor
type CollectionExecutor ¶
type CollectionExecutor interface {
Execute() ([]contract.Subscription, error)
}
func NewAllExecutor ¶
func NewAllExecutor(db SubscriptionLoader) CollectionExecutor
func NewCategoriesExecutor ¶
func NewCategoriesExecutor(db SubscriptionLoader, categories []string) CollectionExecutor
type DeleteExecutor ¶
type DeleteExecutor interface {
Execute() error
}
DeleteExecutor handles the deletion of a subscription. Returns ErrNSubscriptionNotFound if a subscription could not be found with a matching ID
func NewDeleteByIDExecutor ¶
func NewDeleteByIDExecutor(db SubscriptionDeleter, did string) DeleteExecutor
NewDeleteByIDExecutor creates a new DeleteExecutor which deletes a subscription based on id.
func NewDeleteBySlugExecutor ¶
func NewDeleteBySlugExecutor(db SubscriptionDeleter, dslug string) DeleteExecutor
NewDeleteBySlugExecutor creates a new DeleteExecutor which deletes a subscription based on slug.
type IdExecutor ¶
type IdExecutor interface {
Execute() (contract.Subscription, error)
}
func NewIdExecutor ¶
func NewIdExecutor(db SubscriptionLoader, id string) IdExecutor
func NewSlugExecutor ¶
func NewSlugExecutor(db SubscriptionLoader, slug string) IdExecutor
type SubscriptionDeleter ¶
type SubscriptionDeleter interface { DeleteSubscriptionById(id string) error DeleteSubscriptionBySlug(id string) error }
SubscriptionDeleter deletes subscriptions.
type SubscriptionLoader ¶
type SubscriptionLoader interface { GetSubscriptions() ([]contract.Subscription, error) GetSubscriptionById(id string) (contract.Subscription, error) GetSubscriptionBySlug(slug string) (contract.Subscription, error) GetSubscriptionByCategories(categories []string) ([]contract.Subscription, error) }
SubscriptionLoader provides functionality for obtaining Subscriptions.
type SubscriptionUpdater ¶
type SubscriptionUpdater interface { UpdateSubscription(s contract.Subscription) error SubscriptionLoader }
SubscriptionUpdater updates subscriptions.
type SubscriptionWriter ¶
type SubscriptionWriter interface {
AddSubscription(s contract.Subscription) (string, error)
}
SubscriptionWriter adds subscriptions.
type UpdateExecutor ¶
type UpdateExecutor interface {
Execute() error
}
func NewUpdateExecutor ¶
func NewUpdateExecutor(database SubscriptionUpdater, subscription models.Subscription) UpdateExecutor
Click to show internal directories.
Click to hide internal directories.