subscription

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(
	repo Repository,
	entity core.EntityService,
	policy core.PolicyService,
) core.SubscriptionService

NewRepository creates a new collection repository

Types

type Handler

type Handler interface {
	GetSubscription(c echo.Context) error
	GetOwnSubscriptions(c echo.Context) error
}

Handler is the interface for handling HTTP requests

func NewHandler

func NewHandler(service core.SubscriptionService) Handler

NewHandler creates a new handler

type Repository

type Repository interface {
	CreateSubscription(ctx context.Context, subscription core.Subscription) (core.Subscription, error)
	UpdateSubscription(ctx context.Context, subscription core.Subscription) (core.Subscription, error)
	GetSubscription(ctx context.Context, id string) (core.Subscription, error)
	DeleteSubscription(ctx context.Context, id string) error
	GetSubscriptionsByAuthor(ctx context.Context, owner string) ([]core.Subscription, error)
	GetSubscriptionsByAuthorOwned(ctx context.Context, owner string) ([]core.Subscription, error)

	CreateItem(ctx context.Context, item core.SubscriptionItem) (core.SubscriptionItem, error)
	GetItem(ctx context.Context, id string, subscription string) (core.SubscriptionItem, error)
	DeleteItem(ctx context.Context, id string, subscription string) error
}

Repository is the interface for collection repository

func NewRepository

func NewRepository(db *gorm.DB, schema core.SchemaService) Repository

NewRepository creates a new collection repository

Jump to

Keyboard shortcuts

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