eventable

package
v0.0.0-...-95c851e Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeedUpdateEvent  = "feed-update"
	FeedDeleteEvent  = "feed-delete"
	FeedSetTagsEvent = "feed-set-tags"
)
View Source
const (
	ArticleStateEvent = "article-state-change"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleStateData

type ArticleStateData struct {
	User    content.Login          `json:"user"`
	State   string                 `json:"state"`
	Value   bool                   `json:"value"`
	Options map[string]interface{} `json:"options"`
}

func (ArticleStateData) UserLogin

func (e ArticleStateData) UserLogin() content.Login

type Event

type Event struct {
	Name string
	Data interface{}
}

type FeedData

type FeedData interface {
	FeedID() content.FeedID
}

type FeedDeleteData

type FeedDeleteData struct {
	Feed content.Feed
}

func (FeedDeleteData) FeedID

func (f FeedDeleteData) FeedID() content.FeedID

func (FeedDeleteData) MarshalJSON

func (f FeedDeleteData) MarshalJSON() ([]byte, error)

type FeedSetTagsData

type FeedSetTagsData struct {
	Feed content.Feed
	User content.User
	Tags []*content.Tag
}

func (FeedSetTagsData) FeedID

func (f FeedSetTagsData) FeedID() content.FeedID

func (FeedSetTagsData) MarshalJSON

func (f FeedSetTagsData) MarshalJSON() ([]byte, error)

type FeedUpdateData

type FeedUpdateData struct {
	Feed        content.Feed
	NewArticles []content.Article
}

func (FeedUpdateData) FeedID

func (f FeedUpdateData) FeedID() content.FeedID

func (FeedUpdateData) MarshalJSON

func (f FeedUpdateData) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	repo.Service
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, s repo.Service, log log.Log) Service

func (Service) ArticleRepo

func (s Service) ArticleRepo() repo.Article

func (Service) FeedRepo

func (s Service) FeedRepo() repo.Feed

func (Service) Listener

func (s Service) Listener() Stream

type Stream

type Stream chan Event

type UserData

type UserData interface {
	UserLogin() content.Login
}

Jump to

Keyboard shortcuts

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