subscription

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOutDatedSubscriptionTypes

func CheckOutDatedSubscriptionTypes(db *gorm.DB, workerAmount int) error

gets new items from a subscription type

func SetDestinationHandler

func SetDestinationHandler(destType string, handler DestinationHandler)

func SetSubTypeHandler

func SetSubTypeHandler(subType string, handler SubscriptionTypeHandler)

Types

type DestinationHandler

type DestinationHandler interface {
	Dispatch(id string, item SubscriptionItem) error
}

a destination that a subscription item can be sent to such as a discord channel

func GetDestinationHandler

func GetDestinationHandler(destType string) DestinationHandler

type SubscriptionItem

type SubscriptionItem struct {
	Title       string
	Url         string
	Image       string
	Author      string
	Description string
	Tags        string
	Type        string
	TimeID      int64 // integer that determines e.g. a created time or post id
}

type SubscriptionTypeHandler

type SubscriptionTypeHandler interface {
	GetNewItems(tags string) []SubscriptionItem
	Validate(tags string) (string, error)
}

func GetSubTypeHandler

func GetSubTypeHandler(subType string) SubscriptionTypeHandler

Jump to

Keyboard shortcuts

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