notify

package
v0.0.0-...-92cc422 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

Index

Constants

View Source
const (
	//
	MsgCodeStart = iota

	//
	MsgCodeNotifyWithKey

	//
	MsgCodeNotify

	//
	MsgCodeStop
	MsgCodeMax
)
View Source
const (
	DefaultAddressLength = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(ps *pss.Pss) *Controller

func (*Controller) Handler

func (c *Controller) Handler(smsg []byte, p *p2p.Peer, asymmetric bool, keyid string) error

func (*Controller) IsActive

func (c *Controller) IsActive(name string) bool

func (*Controller) NewNotifier

func (c *Controller) NewNotifier(name string, threshold int, updateC <-chan []byte) (func(), error)

func (*Controller) RemoveNotifier

func (c *Controller) RemoveNotifier(name string) error

func (*Controller) Subscribe

func (c *Controller) Subscribe(name string, pubkey *ecdsa.PublicKey, address pss.PssAddress, handler func(string, []byte) error) error

func (*Controller) Unsubscribe

func (c *Controller) Unsubscribe(name string) error

type Msg

type Msg struct {
	Code    byte
	Name    []byte
	Payload []byte
	// contains filtered or unexported fields
}

func NewMsg

func NewMsg(code byte, name string, payload []byte) *Msg

func NewMsgFromPayload

func NewMsgFromPayload(payload []byte) (*Msg, error)

Jump to

Keyboard shortcuts

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