testnetwork

package
v3.0.0-alpha.30 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package testnetwork provides an in-memory implementation of rpc.Network for testing purposes.

Index

Constants

View Source
const PeerAndNonce_TypeID = 0x9fae1e732359c0b5

PeerAndNonce_TypeID is the unique identifier for the type PeerAndNonce.

Variables

This section is empty.

Functions

func RegisterSchema

func RegisterSchema(reg *schemas.Registry)

Types

type Joiner

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

A Joiner is a global view of a test network, which can be joined by a peer to acquire a Network.

func NewJoiner

func NewJoiner() *Joiner

func (*Joiner) Join

func (j *Joiner) Join() rpc.Network

type PeerAndNonce

type PeerAndNonce capnp.Struct

func NewPeerAndNonce

func NewPeerAndNonce(s *capnp.Segment) (PeerAndNonce, error)

func NewRootPeerAndNonce

func NewRootPeerAndNonce(s *capnp.Segment) (PeerAndNonce, error)

func ReadRootPeerAndNonce

func ReadRootPeerAndNonce(msg *capnp.Message) (PeerAndNonce, error)

func (PeerAndNonce) DecodeFromPtr

func (PeerAndNonce) DecodeFromPtr(p capnp.Ptr) PeerAndNonce

func (PeerAndNonce) EncodeAsPtr

func (s PeerAndNonce) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (PeerAndNonce) IsValid

func (s PeerAndNonce) IsValid() bool

func (PeerAndNonce) Message

func (s PeerAndNonce) Message() *capnp.Message

func (PeerAndNonce) Nonce

func (s PeerAndNonce) Nonce() uint64

func (PeerAndNonce) PeerId

func (s PeerAndNonce) PeerId() uint64

func (PeerAndNonce) Segment

func (s PeerAndNonce) Segment() *capnp.Segment

func (PeerAndNonce) SetNonce

func (s PeerAndNonce) SetNonce(v uint64)

func (PeerAndNonce) SetPeerId

func (s PeerAndNonce) SetPeerId(v uint64)

func (PeerAndNonce) String

func (s PeerAndNonce) String() string

func (PeerAndNonce) ToPtr

func (s PeerAndNonce) ToPtr() capnp.Ptr

type PeerAndNonce_Future

type PeerAndNonce_Future struct{ *capnp.Future }

PeerAndNonce_Future is a wrapper for a PeerAndNonce promised by a client call.

func (PeerAndNonce_Future) Struct

func (f PeerAndNonce_Future) Struct() (PeerAndNonce, error)

type PeerAndNonce_List

type PeerAndNonce_List = capnp.StructList[PeerAndNonce]

PeerAndNonce_List is a list of PeerAndNonce.

func NewPeerAndNonce_List

func NewPeerAndNonce_List(s *capnp.Segment, sz int32) (PeerAndNonce_List, error)

NewPeerAndNonce creates a new list of PeerAndNonce.

type PeerID

type PeerID uint64

PeerID is the implementation of peer ids used by a test network

Jump to

Keyboard shortcuts

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