registry

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Groups

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

Groups represents a collection of Keep groups in which the given client is a member.

func NewGroupRegistry

func NewGroupRegistry(
	relayChain relaychain.GroupRegistrationInterface,
	persistence persistence.Handle,
) *Groups

NewGroupRegistry returns an empty GroupRegistry.

func (*Groups) GetGroup

func (g *Groups) GetGroup(groupPublicKey []byte) []*Membership

GetGroup gets a group by a groupPublicKey

func (*Groups) LoadExistingGroups

func (g *Groups) LoadExistingGroups()

LoadExistingGroups iterates over all stored memberships on disk and loads them into memory

func (*Groups) RegisterGroup

func (g *Groups) RegisterGroup(
	signer *dkg.ThresholdSigner,
	channelName string,
) error

RegisterGroup registers that a group was successfully created by the given groupPublicKey.

func (*Groups) UnregisterStaleGroups

func (g *Groups) UnregisterStaleGroups()

UnregisterStaleGroups lookup for groups that have been marked as stale on-chain. A stale group is a group that has expired and a certain time passed after the group expiration. This guarantees the group will not be selected to a new operation and it cannot have an ongoing operation for which it could be selected before it expired. Such a group can be safely removed from the registry and archived in the underlying storage.

type Membership

type Membership struct {
	Signer      *dkg.ThresholdSigner
	ChannelName string
}

Membership represents a member of a group

func (*Membership) Marshal

func (m *Membership) Marshal() ([]byte, error)

Marshal converts Membership to a byte array.

func (*Membership) Unmarshal

func (m *Membership) Unmarshal(bytes []byte) error

Unmarshal converts a byte array produced by Marshal to Membership.

Directories

Path Synopsis
gen
pb

Jump to

Keyboard shortcuts

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