common

package
v0.0.0-...-52bbd4c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: GPL-3.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const EndOfSession = math.MaxUint8

EndOfSession is the final state of all sessions

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast func(msg []byte) error

Broadcast ...

type CtxCallback

type CtxCallback interface {
	// IsMember returns if an account is a member of a group
	IsMember(group ethcommon.Address, account ethcommon.Address) error

	// GetBoxerOfGroup returns the current key of a group
	GetBoxerOfGroup(group ethcommon.Address) (tribecrypto.SymmetricKey, error)

	// GetProposedBoxerOfGroup returns the proposed group key of a group
	// that was suggested the given member
	GetProposedBoxerOfGroup(group ethcommon.Address, proposer ethcommon.Address) (tribecrypto.SymmetricKey, error)
}

CtxCallback is used by sessions to get specific group data without access to all GroupContext functions and data

type GetGroupDataCallback

type GetGroupDataCallback func(addr ethcommon.Address) (interfaces.IGroup, *fs.GroupRepo)

GetGroupDataCallback is used for retrieving group data

type ISession

type ISession interface {
	ID() uint32
	IsAlive() bool
	Abort()
	NextState(contact *common.Contact, data []byte)
	State() uint8
	Run()
	Error() error
}

ISession is a session interface. Sessions are implemented as Finite State Machines.

type OnGetGroupKeySuccessCallback

type OnGetGroupKeySuccessCallback func(address ethcommon.Address, boxer tribecrypto.SymmetricKey)

OnGetGroupKeySuccessCallback is called when a group key is retrieved successfully

type SessionClosedCallback

type SessionClosedCallback func(session ISession)

SessionClosedCallback is called when a session is closed

Jump to

Keyboard shortcuts

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