translate

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IncompleteKey = errors.New("incomplete key")
View Source
var UnknownKey = errors.New("unknown key")

Functions

func KeyToPath

func KeyToPath(k ds.Key) (id peer.ID, p string, err error)

Types

type AddrBookRecord

type AddrBookRecord struct {
	// The multiaddresses. This is a sorted list where element 0 expires the soonest.
	Addrs []*AddrBookRecord_AddrEntry `json:"addrs,omitempty"`
	// The most recently received signed PeerRecord.
	CertifiedRecord *AddrBookRecord_CertifiedRecord `json:"certified_record,omitempty"`
}

type AddrBookRecord_AddrEntry

type AddrBookRecord_AddrEntry struct {
	Addr ma.Multiaddr `json:"addr,omitempty"`
	// The point in time when this address expires.
	Expiry int64 `json:"expiry,omitempty"`
	// The original TTL of this address.
	Ttl int64 `json:"ttl,omitempty"`
}

type AddrBookRecord_CertifiedRecord

type AddrBookRecord_CertifiedRecord struct {
	// The Seq counter from the signed PeerRecord envelope
	Seq uint64 `json:"seq,omitempty"`
	// The serialized bytes of the SignedEnvelope containing the PeerRecord. (encoded as hex)
	Raw string `json:"raw,omitempty"`
}

type ENRData

type ENRData struct {
	Raw      string            `json:"raw,omitempty"`
	Contents map[string]string `json:"contents,omitempty"`
}

type Entry

type Entry struct {
	Key   string
	Value interface{} // should be either something json-encodeable
}

type Eth2Data

type Eth2Data struct {
	Metadata      *methods.MetaData `json:"metadata,omitempty"`
	MetadataClaim methods.SeqNr     `json:"metadata_claim,omitempty"`
	Status        *methods.Status   `json:"status,omitempty"`
	ENR           *ENRData          `json:"enr,omitempty"`
}

type PartialPeerstoreEntry

type PartialPeerstoreEntry struct {
	Eth2            *Eth2Data       `json:"eth2,omitempty"`
	AddrRecords     *AddrBookRecord `json:"addr_records,omitempty"`
	Protocols       []string        `json:"protocols,omitempty"`
	ProtocolVersion string          `json:"protocol_version,omitempty"`
	UserAgent       string          `json:"user_agent,omitempty"`
	Pubkey          string          `json:"pub,omitempty"` // raw bytes, not the protobuf representation
	NodeID          string          `json:"node_id,omitempty"`
}

func ItemToEntry

func ItemToEntry(k ds.Key, v []byte) (id peer.ID, out PartialPeerstoreEntry, err error)

func (*PartialPeerstoreEntry) Merge

func (*PartialPeerstoreEntry) ToCSV

func (p *PartialPeerstoreEntry) ToCSV(prefixFields ...string) (out [][]string)

Jump to

Keyboard shortcuts

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