grid

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootUsername = "root"
	RootTagName  = "root"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppProxy

type AppProxy interface {
	GetAppID() string
	// contains filtered or unexported methods
}

type AppProxyImpl

type AppProxyImpl struct {
	// contains filtered or unexported fields
}

func NewAppProxy

func NewAppProxy(app *domain.App) *AppProxyImpl

func (*AppProxyImpl) GetAppID

func (p *AppProxyImpl) GetAppID() string

type BroadcasterFactory

type BroadcasterFactory interface {
	GetBroadcaster() domain.NotificationBroadcaster
}

type Grid

type Grid interface {
	util.Starter
	AddUser(username string)
	ReceiveAppNotification(notification model.AppNotification) (appID string)
	GetUserProxy(userID string) (UserProxy, error)
	// contains filtered or unexported methods
}

type GridImpl

type GridImpl struct {
	// contains filtered or unexported fields
}

func NewGrid

func NewGrid(repositoryFactory RepositoryFactory, broadcasterFactory BroadcasterFactory) *GridImpl

func (*GridImpl) AddUser

func (g *GridImpl) AddUser(username string)

func (*GridImpl) GetUserProxy

func (g *GridImpl) GetUserProxy(username string) (UserProxy, error)

func (*GridImpl) ReceiveAppNotification

func (g *GridImpl) ReceiveAppNotification(appNotification model.AppNotification) (appID string)

func (*GridImpl) Start

func (g *GridImpl) Start()

type RepositoryFactory

type RepositoryFactory interface {
	GetRepository() domain.NotificationRepository
}

type UserProxy

type UserProxy interface {
	SubscribeUserToTag(tag *domain.Tag)
	RegisterClient(interface{})
	GetLastNotifications(n int) []model.ClientNotification
	GetNotifications(from, to int) []model.ClientNotification
	GetAllNotifications() []model.ClientNotification
	GetNotificationCount() int
}

type UserProxyImpl

type UserProxyImpl struct {
	// contains filtered or unexported fields
}

func NewUserProxy

func NewUserProxy(username string, repo domain.NotificationRepository, broadcaster domain.NotificationBroadcaster) *UserProxyImpl

func (*UserProxyImpl) GetAllNotifications

func (p *UserProxyImpl) GetAllNotifications() []model.ClientNotification

func (*UserProxyImpl) GetLastNotifications

func (p *UserProxyImpl) GetLastNotifications(n int) []model.ClientNotification

func (*UserProxyImpl) GetNotificationCount

func (p *UserProxyImpl) GetNotificationCount() int

func (*UserProxyImpl) GetNotifications

func (p *UserProxyImpl) GetNotifications(from, to int) []model.ClientNotification

func (*UserProxyImpl) RegisterClient

func (p *UserProxyImpl) RegisterClient(conn interface{})

func (*UserProxyImpl) SubscribeUserToTag

func (p *UserProxyImpl) SubscribeUserToTag(tag *domain.Tag)

Jump to

Keyboard shortcuts

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