common

package
v0.0.0-...-e3e94bd Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PKIidToStr

func PKIidToStr(id []byte) string

Types

type ChannelID

type ChannelID []byte

func (ChannelID) String

func (c ChannelID) String() string

计算 channel id 的十六进制字符串。

type InvalidationResult

type InvalidationResult int
const (
	MessageNoAction InvalidationResult = iota
	// 意味着消息将其他消息弄成无效的了。
	MessageInvalidates
	// 意味着消息被其他消息弄成无效的了。
	MessageInvalidated
)

type MessageAcceptor

type MessageAcceptor func(interface{}) bool

MessageAcceptor 是一个谓词,用于确定创建 MessageAcceptor 实例的订阅者对哪些消息感兴趣。

type MessageReplacingPolicy

type MessageReplacingPolicy func(this interface{}, that interface{}) InvalidationResult

MessageReplacingPolicy 返回: MESSAGE_INVALIDATES(如果该消息使那条消息无效); MESSAGE_INVALIDATED(如果此消息被那条该消息搞得无效); MESSAGE_NO_ACTION。

type PKIid

type PKIid []byte

PKIid 的计算方法如下所示:

  1. 对 api.PeerIdentity 进行 protobuf 的反序列化,得到 *pbmsp.SerializedIdentity{mspid, cert};
  2. 然后计算 sha256.Sum(mspid||cert),其中 mspid 是 msp 的 id,cert 是节点的 ASN.1 DER PEM 格式的 x509 证书;
  3. 将第二步得到的值作为 PKIid。

func StrToPKIid

func StrToPKIid(idStr string) PKIid

func (PKIid) Equal

func (id PKIid) Equal(other PKIid) bool

func (PKIid) String

func (id PKIid) String() string

type TLSCertificates

type TLSCertificates struct {
	TLSServerCert atomic.Value
	TLSClientCert atomic.Value
}

Jump to

Keyboard shortcuts

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