observer

package
v0.0.0-...-4c0fd1a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewObserver)

ProviderSet is observer providers.

Functions

This section is empty.

Types

type ChatsObserver

type ChatsObserver interface {
	Register(int64, int64, chan *v1.NewMessage)
	Deregister(int64, int64)
	Publish(int64, *v1.NewMessage)
}

func NewObserver

func NewObserver(logger log.Logger) ChatsObserver

type Observer

type Observer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Observer) Deregister

func (o *Observer) Deregister(chatId, userId int64)

func (*Observer) Publish

func (o *Observer) Publish(chatId int64, msg *v1.NewMessage)

func (*Observer) Register

func (o *Observer) Register(chatId, userId int64, channel chan *v1.NewMessage)

Jump to

Keyboard shortcuts

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