connection

package
v0.0.0-...-6d19cb1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncCredential

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

func (*AsyncCredential) Await

type ChannelProposal

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

type Connection

type Connection struct {
	*client.Channel
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(ch *client.Channel) *Connection

func (*Connection) Close

func (c *Connection) Close(ctx context.Context) error

func (*Connection) Disputed

func (c *Connection) Disputed() bool

func (*Connection) HandleUpdate

func (conn *Connection) HandleUpdate(cur *channel.State, update client.ChannelUpdate, responder *client.UpdateResponder)

func (*Connection) NextCredentialRequest

func (c *Connection) NextCredentialRequest(ctx context.Context) (*CredentialRequest, error)

func (*Connection) RequestCredential

func (c *Connection) RequestCredential(
	ctx context.Context,
	doc []byte,
	price channel.Bal,
	issuer common.Address,
) (*AsyncCredential, error)

func (*Connection) TryClose

func (c *Connection) TryClose(ctx context.Context, attempts int) error

func (*Connection) WaitConcludadable

func (c *Connection) WaitConcludadable(ctx context.Context) error

type ConnectionRequest

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

func NewConnectionRequest

func NewConnectionRequest(
	p *ChannelProposal,
	acc wallet.Address,
	registry *Registry,
) *ConnectionRequest

func (*ConnectionRequest) Accept

func (r *ConnectionRequest) Accept(ctx context.Context) (*Connection, error)

func (*ConnectionRequest) Peer

func (r *ConnectionRequest) Peer() wallet.Address

type CredentialProposal

type CredentialProposal struct {
	*client.UpdateResponder
	Signature []byte
}

type CredentialRequest

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

func (*CredentialRequest) CheckDoc

func (r *CredentialRequest) CheckDoc(doc []byte) error

func (*CredentialRequest) CheckPrice

func (r *CredentialRequest) CheckPrice(p *big.Int) error

func (*CredentialRequest) IssueCredential

func (r *CredentialRequest) IssueCredential(ctx context.Context, acc *simple.Account) error

type CredentialRequestResponse

type CredentialRequestResponse interface {
	Context() context.Context
	Result() chan error
}

type CredentialRequestResponseAccept

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

func (*CredentialRequestResponseAccept) Context

func (*CredentialRequestResponseAccept) Result

func (r *CredentialRequestResponseAccept) Result() chan error

type EventHandler

type EventHandler struct {
	*Connection
}

func NewEventHandler

func NewEventHandler(conn *Connection) *EventHandler

func (*EventHandler) HandleAdjudicatorEvent

func (h *EventHandler) HandleAdjudicatorEvent(e channel.AdjudicatorEvent)

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Add

func (r *Registry) Add(conn *Connection)

func (*Registry) ForID

func (r *Registry) ForID(id channel.ID) (*Connection, bool)

Jump to

Keyboard shortcuts

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