Documentation
¶
Index ¶
- func PairsToCids(pairs []CidChannelPair) []cid.Cid
- type CidChannelPair
- type Set
- func (s *Set) Add(c CidChannelPair)
- func (s *Set) Cids() []cid.Cid
- func (s *Set) ForEach(f func(c CidChannelPair) error) error
- func (s *Set) Has(c CidChannelPair) bool
- func (s *Set) Keys() []CidChannelPair
- func (s *Set) Len() int
- func (s *Set) Remove(c CidChannelPair)
- func (s *Set) Visit(c CidChannelPair) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PairsToCids ¶ added in v0.1.1
func PairsToCids(pairs []CidChannelPair) []cid.Cid
Types ¶
type CidChannelPair ¶ added in v0.2.0
CidChannelPair is a pair of IPLD channel and cid.
func CidsToPairs ¶ added in v0.1.1
func CidsToPairs(cids []cid.Cid, chn channel.Channel) []CidChannelPair
func PublicCidPair ¶
func PublicCidPair(c cid.Cid) CidChannelPair
PublicCidPair returns a pair consisting of the public IPLD channel and the specified cid.
func (CidChannelPair) Defined ¶ added in v0.2.0
func (p CidChannelPair) Defined() bool
Defined returns true if a CidChannelPair is defined Calling any other methods on an undefined CidChannelPair will result in undefined behavior.
func (CidChannelPair) Equals ¶ added in v0.2.0
func (p CidChannelPair) Equals(o CidChannelPair) bool
Equals checks that two CidChannelPairs are the same.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a implementation of a set of ChannelCidChannelPairPair, that is, a structure to which holds a single copy of every CidChannelPairs that is added to it.
func NewSetFromPairs ¶
func NewSetFromPairs(pairs []CidChannelPair) *Set
NewSetFromPairs initializes and returns a new Set from a slice of CidChannelPairs.
func (*Set) Cids ¶
func (s *Set) Cids() []cid.Cid
Cids returns all the unique Cids in the CidChannelPairs in the set.
func (*Set) ForEach ¶
func (s *Set) ForEach(f func(c CidChannelPair) error) error
ForEach allows to run a custom function on each CidChannelPair in the set.
func (*Set) Has ¶
func (s *Set) Has(c CidChannelPair) bool
Has returns if the Set contains a given CidChannelPair.
func (*Set) Keys ¶
func (s *Set) Keys() []CidChannelPair
Keys returns the CidChannelPairs in the set.
func (*Set) Remove ¶
func (s *Set) Remove(c CidChannelPair)
Remove deletes a CidChannelPair from the Set.
func (*Set) Visit ¶
func (s *Set) Visit(c CidChannelPair) bool
Visit adds a CidChannelPair to the set only if it is not in it already.