common

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePeerIdCertBytesMapToPeerIdCertMap

func ParsePeerIdCertBytesMapToPeerIdCertMap(peerIdCertBytesMap map[string][]byte) (map[string]*cmx509.Certificate, error)

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

func (v *MemberStatusValidator) AddAC(chainId string, ac protocol.AccessControlProvider)

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) (bool, error)

ValidateMemberStatus check the status of members.

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 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