subscription

package
v1.2.2-dev.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

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 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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