channel

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateChannelKeypair

func GenerateChannelKeypair(rootAccountKP *keypair.Full, channelIndex int, salt string) (*keypair.Full, error)

GenerateChannelKeypair deterministically generates a keypair using the root account keypair, channel index, and configured channel salt.

func GenerateToken

func GenerateToken() (string, error)

GenerateToken generates a random token for acquiring a channel lock.

Types

type Channel

type Channel struct {
	KP   *keypair.Full
	Lock Lock
}

type Lock

type Lock interface {
	// Unlock releases the lock.
	Unlock() error
}

type Pool

type Pool interface {
	// GetChannel returns a full keypair available for use as a channel. The pool does not ensure that the account is
	// created or funded, therefore callers of this function must handle that logic.
	//
	// Callers are expected to call Unlock on the channel lock once finished using it.
	GetChannel() (channel *Channel, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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