notifier

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotInvalid NotType = iota

	GroupCreate     = 11
	GroupDismiss    = 12
	GroupChangeName = 13
	GroupMemQuit    = 14
	GroupMemKickOut = 15
	GroupMemberAdd  = 16

	AccountUpdate = 21

	FriendUpdate = 31
)
View Source
const (
	PSTAccount = 1
	PSTGroup   = 2
	PSTAccGrp  = 3
	PSTFriends = 4
)
View Source
const (
	BlockTimeInterval = time.Minute * 5
	CachedChanSize    = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountDelegate

type AccountDelegate interface {
	UpdateAccount(isLocal bool, meta *pbs.AccountMeta) error
	GroupOperate(isLocal bool, meta *pbs.GroupMeta) error
	FriendOperate(isLocal bool, meta *pbs.FriendMeta) error
}

type BlockDelegate

type BlockDelegate interface {
	ProcMinedNewBlockByPrime(block *pbs.BlockMined) error
}

type ChainNotifier

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

func Inst

func Inst() *ChainNotifier

func (*ChainNotifier) BroadCastNewBlock

func (n *ChainNotifier) BroadCastNewBlock(bm *pbs.BlockMined) error

func (*ChainNotifier) GetBlockDelegate

func (n *ChainNotifier) GetBlockDelegate() BlockDelegate

func (*ChainNotifier) IndexChange

func (n *ChainNotifier) IndexChange(idx Index)

func (*ChainNotifier) IndexSignal

func (n *ChainNotifier) IndexSignal() chan Index

func (*ChainNotifier) NotifierFromP2pNetwork

func (n *ChainNotifier) NotifierFromP2pNetwork(w *worker.TopicWorker)

func (*ChainNotifier) NotifierSignal

func (n *ChainNotifier) NotifierSignal() chan *pbs.Notifier

func (*ChainNotifier) Notify

func (n *ChainNotifier) Notify(item *pbs.Notifier)

func (*ChainNotifier) SetAccountDelegate

func (n *ChainNotifier) SetAccountDelegate(ad AccountDelegate)

func (*ChainNotifier) SetBlockDelegate

func (n *ChainNotifier) SetBlockDelegate(bd BlockDelegate)

func (*ChainNotifier) SetID

func (n *ChainNotifier) SetID(id string)

type Index

type Index struct {
	Key string       `json:"key"`
	Typ PeerSyncType `json:"type"`
}

func KeyToIdx

func KeyToIdx(s string) (*Index, error)

func NewIndex

func NewIndex(k string, t int32) Index

func (*Index) IdxKey

func (i *Index) IdxKey() string

type NotType

type NotType int8

func GrpOpTypeToNotType

func GrpOpTypeToNotType(got pbs.GrpOpType) NotType

func (NotType) CovertToGrpOpType

func (nt NotType) CovertToGrpOpType() pbs.GrpOpType

type PeerSyncData

type PeerSyncData []*PeerSyncItem

type PeerSyncItem

type PeerSyncItem struct {
	Idx Index  `json:"index"`
	Raw []byte `json:"data"`
}

type PeerSyncType

type PeerSyncType int8

Jump to

Keyboard shortcuts

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