p2p

package
v0.0.0-...-84e2623 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HandshakeStage_name = map[int32]string{
		0: "UNSPECIFIED_HANDSHAKE",
		1: "INITIAL",
		2: "FINAL",
		3: "UPDATE",
	}
	HandshakeStage_value = map[string]int32{
		"UNSPECIFIED_HANDSHAKE": 0,
		"INITIAL":               1,
		"FINAL":                 2,
		"UPDATE":                3,
	}
)

Enum value maps for HandshakeStage.

View Source
var File_types_p2p_addrbook_proto protoreflect.FileDescriptor
View Source
var File_types_p2p_peering_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Addrbook

type Addrbook struct {
	Entries []*AddrbookEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

Addrbook contains entries about peers.

func (*Addrbook) Descriptor deprecated

func (*Addrbook) Descriptor() ([]byte, []int)

Deprecated: Use Addrbook.ProtoReflect.Descriptor instead.

func (*Addrbook) GetEntries

func (x *Addrbook) GetEntries() []*AddrbookEntry

func (*Addrbook) ProtoMessage

func (*Addrbook) ProtoMessage()

func (*Addrbook) ProtoReflect

func (x *Addrbook) ProtoReflect() protoreflect.Message

func (*Addrbook) Reset

func (x *Addrbook) Reset()

func (*Addrbook) String

func (x *Addrbook) String() string

type AddrbookEntry

type AddrbookEntry struct {
	Peer              string  `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
	MaxAttempts       uint32  `protobuf:"varint,2,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"`
	DefaultBackoff    uint64  `protobuf:"varint,3,opt,name=default_backoff,json=defaultBackoff,proto3" json:"default_backoff,omitempty"`
	MaxBackoff        uint64  `protobuf:"varint,4,opt,name=max_backoff,json=maxBackoff,proto3" json:"max_backoff,omitempty"`
	BackoffMultiplier float32 `protobuf:"fixed32,5,opt,name=backoff_multiplier,json=backoffMultiplier,proto3" json:"backoff_multiplier,omitempty"`
	Attempts          uint32  `protobuf:"varint,6,opt,name=attempts,proto3" json:"attempts,omitempty"`
	FailedAttempts    uint32  `protobuf:"varint,7,opt,name=failed_attempts,json=failedAttempts,proto3" json:"failed_attempts,omitempty"`
	LastSuccess       uint64  `protobuf:"varint,8,opt,name=last_success,json=lastSuccess,proto3" json:"last_success,omitempty"`
	Backoff           uint64  `protobuf:"varint,9,opt,name=backoff,proto3" json:"backoff,omitempty"`
	Persistent        bool    `protobuf:"varint,10,opt,name=persistent,proto3" json:"persistent,omitempty"`
	// contains filtered or unexported fields
}

AddrbookEntry is for storing and transfering information about peers. This structure contains the information about connectivity history with that peer.

func AddrbookEntryFromPeer

func AddrbookEntryFromPeer(peer string) *AddrbookEntry

func AddrbookFromPeers

func AddrbookFromPeers(peers []string) []*AddrbookEntry

func (*AddrbookEntry) Descriptor deprecated

func (*AddrbookEntry) Descriptor() ([]byte, []int)

Deprecated: Use AddrbookEntry.ProtoReflect.Descriptor instead.

func (*AddrbookEntry) GetAttempts

func (x *AddrbookEntry) GetAttempts() uint32

func (*AddrbookEntry) GetBackoff

func (x *AddrbookEntry) GetBackoff() uint64

func (*AddrbookEntry) GetBackoffMultiplier

func (x *AddrbookEntry) GetBackoffMultiplier() float32

func (*AddrbookEntry) GetDefaultBackoff

func (x *AddrbookEntry) GetDefaultBackoff() uint64

func (*AddrbookEntry) GetFailedAttempts

func (x *AddrbookEntry) GetFailedAttempts() uint32

func (*AddrbookEntry) GetLastSuccess

func (x *AddrbookEntry) GetLastSuccess() uint64

func (*AddrbookEntry) GetMaxAttempts

func (x *AddrbookEntry) GetMaxAttempts() uint32

func (*AddrbookEntry) GetMaxBackoff

func (x *AddrbookEntry) GetMaxBackoff() uint64

func (*AddrbookEntry) GetPeer

func (x *AddrbookEntry) GetPeer() string

func (*AddrbookEntry) GetPersistent

func (x *AddrbookEntry) GetPersistent() bool

func (*AddrbookEntry) ProtoMessage

func (*AddrbookEntry) ProtoMessage()

func (*AddrbookEntry) ProtoReflect

func (x *AddrbookEntry) ProtoReflect() protoreflect.Message

func (*AddrbookEntry) Reset

func (x *AddrbookEntry) Reset()

func (*AddrbookEntry) String

func (x *AddrbookEntry) String() string

type Handshake

type Handshake struct {
	Me        string           `protobuf:"bytes,1,opt,name=me,proto3" json:"me,omitempty"`
	You       string           `protobuf:"bytes,2,opt,name=you,proto3" json:"you,omitempty"`
	Stage     HandshakeStage   `protobuf:"varint,3,opt,name=stage,proto3,enum=types.p2p.HandshakeStage" json:"stage,omitempty"`
	Intents   []*core.Intent   `protobuf:"bytes,4,rep,name=intents,proto3" json:"intents,omitempty"`
	Interests []*core.Interest `protobuf:"bytes,5,rep,name=interests,proto3" json:"interests,omitempty"`
	PublicKey []byte           `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// contains filtered or unexported fields
}

Handshake will contain the information needed for each handshake stage.

func (*Handshake) Descriptor deprecated

func (*Handshake) Descriptor() ([]byte, []int)

Deprecated: Use Handshake.ProtoReflect.Descriptor instead.

func (*Handshake) GetIntents

func (x *Handshake) GetIntents() []*core.Intent

func (*Handshake) GetInterests

func (x *Handshake) GetInterests() []*core.Interest

func (*Handshake) GetMe

func (x *Handshake) GetMe() string

func (*Handshake) GetPublicKey

func (x *Handshake) GetPublicKey() []byte

func (*Handshake) GetStage

func (x *Handshake) GetStage() HandshakeStage

func (*Handshake) GetYou

func (x *Handshake) GetYou() string

func (*Handshake) ProtoMessage

func (*Handshake) ProtoMessage()

func (*Handshake) ProtoReflect

func (x *Handshake) ProtoReflect() protoreflect.Message

func (*Handshake) Reset

func (x *Handshake) Reset()

func (*Handshake) String

func (x *Handshake) String() string

type HandshakeStage

type HandshakeStage int32

HandshakeStage enum specifies what handshake state this message corresponds to.

const (
	HandshakeStage_UNSPECIFIED_HANDSHAKE HandshakeStage = 0
	HandshakeStage_INITIAL               HandshakeStage = 1
	HandshakeStage_FINAL                 HandshakeStage = 2
	HandshakeStage_UPDATE                HandshakeStage = 3
)

func (HandshakeStage) Descriptor

func (HandshakeStage) Enum

func (x HandshakeStage) Enum() *HandshakeStage

func (HandshakeStage) EnumDescriptor deprecated

func (HandshakeStage) EnumDescriptor() ([]byte, []int)

Deprecated: Use HandshakeStage.Descriptor instead.

func (HandshakeStage) Number

func (HandshakeStage) String

func (x HandshakeStage) String() string

func (HandshakeStage) Type

type Peers

type Peers struct {
	Ids    []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	Remove bool     `protobuf:"varint,2,opt,name=remove,proto3" json:"remove,omitempty"`
	// contains filtered or unexported fields
}

Peers is used for sharing peering information so that it would be possible to form a mesh.

func (*Peers) Descriptor deprecated

func (*Peers) Descriptor() ([]byte, []int)

Deprecated: Use Peers.ProtoReflect.Descriptor instead.

func (*Peers) GetIds

func (x *Peers) GetIds() []string

func (*Peers) GetRemove

func (x *Peers) GetRemove() bool

func (*Peers) ProtoMessage

func (*Peers) ProtoMessage()

func (*Peers) ProtoReflect

func (x *Peers) ProtoReflect() protoreflect.Message

func (*Peers) Reset

func (x *Peers) Reset()

func (*Peers) String

func (x *Peers) String() string

Jump to

Keyboard shortcuts

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