common

package
v0.0.0-...-ec6225e Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtensionID = getPrefixedExtensionID([]int{1, 1})

Functions

func PreferServerCipherSuites

func PreferServerCipherSuites() bool

Types

type CertIdPeerIdMapper

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

CertIdPeerIdMapper mapped cert id with peer id.

func NewCertIdPeerIdMapper

func NewCertIdPeerIdMapper(logger protocol.Logger) *CertIdPeerIdMapper

NewCertIdPeerIdMapper create a new CertIdPeerIdMapper instance.

func (*CertIdPeerIdMapper) Add

func (c *CertIdPeerIdMapper) Add(certId string, peerId string)

Add a record mapping cert id with peer id.

func (*CertIdPeerIdMapper) FindPeerIdByCertId

func (c *CertIdPeerIdMapper) FindPeerIdByCertId(certId string) (string, error)

FindPeerIdByCertId will return a peer id if the given cert id has mapped with a peer id .

func (*CertIdPeerIdMapper) RemoveByPeerId

func (c *CertIdPeerIdMapper) RemoveByPeerId(peerId string)

RemoveByPeerId remove all records mapped with given peerId.

type MemberStatusValidator

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

MemberStatusValidator is a validator for validating member status.

func NewMemberStatusValidator

func NewMemberStatusValidator() *MemberStatusValidator

NewMemberStatusValidator create a new MemberStatusValidator instance.

func (*MemberStatusValidator) AddAC

AddAC Add access control of chain to validator.

func (*MemberStatusValidator) AddPeerId

func (v *MemberStatusValidator) AddPeerId(pid string)

AddPeerId Add a pid to blocked list.

func (*MemberStatusValidator) ContainsPeerId

func (v *MemberStatusValidator) ContainsPeerId(pid string) bool

ContainsPeerId return whether pid given exist in blocked list.

func (*MemberStatusValidator) RemovePeerId

func (v *MemberStatusValidator) RemovePeerId(pid string)

RemovePeerId remove pid given from blocked list.

func (*MemberStatusValidator) ValidateMemberStatus

func (v *MemberStatusValidator) ValidateMemberStatus(members []*pbac.Member) ([]string, bool, error)

ValidateMemberStatus check the status of members.

func (*MemberStatusValidator) ValidateMemberStatusWithChain

func (v *MemberStatusValidator) ValidateMemberStatusWithChain(members []*pbac.Member, chainId string) (bool, error)

ValidateMemberStatusWithChain check the status of members with the access control of the chain named chainId given.

type PeerIdChainIdsRecorder

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

PeerIdChainIdsRecorder record the chain ids of peer .

func NewPeerIdChainIdsRecorder

func NewPeerIdChainIdsRecorder(logger protocol.Logger) *PeerIdChainIdsRecorder

func (*PeerIdChainIdsRecorder) AddPeerChainId

func (pcr *PeerIdChainIdsRecorder) AddPeerChainId(peerId string, chainId string) bool

func (*PeerIdChainIdsRecorder) IsPeerBelongToChain

func (pcr *PeerIdChainIdsRecorder) IsPeerBelongToChain(peerId string, chainId string) bool

func (*PeerIdChainIdsRecorder) OnAddNotifyC

func (pcr *PeerIdChainIdsRecorder) OnAddNotifyC(onAddC chan<- string)

func (*PeerIdChainIdsRecorder) OnRemoveNotifyC

func (pcr *PeerIdChainIdsRecorder) OnRemoveNotifyC(onRemoveC chan<- string)

func (*PeerIdChainIdsRecorder) PeerIdsOfChain

func (pcr *PeerIdChainIdsRecorder) PeerIdsOfChain(chainId string) []string

func (*PeerIdChainIdsRecorder) PeerIdsOfNoChain

func (pcr *PeerIdChainIdsRecorder) PeerIdsOfNoChain() []string

func (*PeerIdChainIdsRecorder) RemoveAllByPeerId

func (pcr *PeerIdChainIdsRecorder) RemoveAllByPeerId(peerId string) bool

func (*PeerIdChainIdsRecorder) RemovePeerChainId

func (pcr *PeerIdChainIdsRecorder) RemovePeerChainId(peerId string, chainId string) bool

type PeerIdPubKeyStore

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

PeerIdPubKeyStore record the public key bytes of peer .

func NewPeerIdPubKeyStore

func NewPeerIdPubKeyStore(logger protocol.Logger) *PeerIdPubKeyStore

func (*PeerIdPubKeyStore) GetCertByPeerId

func (p *PeerIdPubKeyStore) GetCertByPeerId(peerId string) []byte

func (*PeerIdPubKeyStore) RemoveByPeerId

func (p *PeerIdPubKeyStore) RemoveByPeerId(peerId string)

func (*PeerIdPubKeyStore) SetPeerPubKey

func (p *PeerIdPubKeyStore) SetPeerPubKey(peerId string, pubKey []byte)

func (*PeerIdPubKeyStore) StoreCopy

func (p *PeerIdPubKeyStore) StoreCopy() map[string][]byte

type PeerIdTlsCertStore

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

PeerIdTlsCertStore record the tls cert bytes of peer .

func NewPeerIdTlsCertStore

func NewPeerIdTlsCertStore(logger protocol.Logger) *PeerIdTlsCertStore

func (*PeerIdTlsCertStore) GetCertByPeerId

func (p *PeerIdTlsCertStore) GetCertByPeerId(peerId string) []byte

func (*PeerIdTlsCertStore) RemoveByPeerId

func (p *PeerIdTlsCertStore) RemoveByPeerId(peerId string)

func (*PeerIdTlsCertStore) SetPeerTlsCert

func (p *PeerIdTlsCertStore) SetPeerTlsCert(peerId string, tlsCert []byte)

func (*PeerIdTlsCertStore) StoreCopy

func (p *PeerIdTlsCertStore) StoreCopy() map[string][]byte

type StringMapList

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

StringMapList is a string list using a perfect map

func NewStringMapList

func NewStringMapList() *StringMapList

NewStringMapList creates a StringMapList

func (*StringMapList) Add

func (b *StringMapList) Add(p string) bool

func (*StringMapList) Contains

func (b *StringMapList) Contains(p string) bool

func (*StringMapList) List

func (b *StringMapList) List() []string

func (*StringMapList) Remove

func (b *StringMapList) Remove(p string) bool

func (*StringMapList) Size

func (b *StringMapList) Size() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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