peer

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingKey when a key is not passed
	ErrMissingKey = errors.New("missing key")
	// ErrECDSAPrivateKeyRequired when a key is not an ECDSA key
	ErrECDSAPrivateKeyRequired = errors.New(
		"network currently requires an ecdsa private key")
)

Functions

This section is empty.

Types

type Addresses

type Addresses []string

type LocalPeer

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

func NewLocalPeer

func NewLocalPeer(
	hostname string,
	key *crypto.PrivateKey,
) (*LocalPeer, error)

func (*LocalPeer) AddAddress

func (p *LocalPeer) AddAddress(protocol string, addrs []string)

func (*LocalPeer) AddContentHash

func (p *LocalPeer) AddContentHash(hashes ...string)

AddContentHash that should be published with the peer info

func (*LocalPeer) AddIdentityKey

func (p *LocalPeer) AddIdentityKey(identityKey *crypto.PrivateKey) error

func (*LocalPeer) GetAddress

func (p *LocalPeer) GetAddress() string

func (*LocalPeer) GetAddresses

func (p *LocalPeer) GetAddresses() []string

func (*LocalPeer) GetContentHashes

func (p *LocalPeer) GetContentHashes() []string

func (*LocalPeer) GetFingerprint

func (p *LocalPeer) GetFingerprint() crypto.Fingerprint

func (*LocalPeer) GetHostname

func (p *LocalPeer) GetHostname() string

func (*LocalPeer) GetPeerKey

func (p *LocalPeer) GetPeerKey() *crypto.PrivateKey

func (*LocalPeer) GetSignedPeer

func (p *LocalPeer) GetSignedPeer() *Peer

GetSignedPeer returns the local peer info

func (*LocalPeer) OnAddressesUpdated

func (p *LocalPeer) OnAddressesUpdated(h OnAddressesUpdated)

func (*LocalPeer) OnContentHashesUpdated

func (p *LocalPeer) OnContentHashesUpdated(h OnContentHashesUpdated)

func (*LocalPeer) RemoveContentHash

func (p *LocalPeer) RemoveContentHash(hashes ...string)

RemoveContentHash from the peer info

type OnAddressesUpdated

type OnAddressesUpdated func([]string)

type OnContentHashesUpdated

type OnContentHashesUpdated func([]string)

type Peer

type Peer struct {
	Addresses []string          `json:"addresses:as"`
	Signature *crypto.Signature `json:"@signature:o"`
}

func (*Peer) Address

func (pi *Peer) Address() string

Address of the peer

func (*Peer) ContextName

func (e *Peer) ContextName() string

func (*Peer) Fingerprint

func (pi *Peer) Fingerprint() crypto.Fingerprint

Fingerprint of signer

func (*Peer) FromObject

func (e *Peer) FromObject(o object.Object) error

func (*Peer) GetType

func (e *Peer) GetType() string

func (*Peer) ToObject

func (e *Peer) ToObject() object.Object

type Requested

type Requested struct {
	Keys      []string            `json:"keys:as"`
	Signature *crypto.Signature   `json:"@signature:o"`
	Authors   []*crypto.PublicKey `json:"@authors:ao"`
}

func (*Requested) EventName

func (e *Requested) EventName() string

func (*Requested) FromObject

func (e *Requested) FromObject(o object.Object) error

func (*Requested) GetType

func (e *Requested) GetType() string

func (*Requested) ToObject

func (e *Requested) ToObject() object.Object

type StringAddressesSyncMap

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

StringAddressesSyncMap -

func NewStringAddressesSyncMap

func NewStringAddressesSyncMap() *StringAddressesSyncMap

NewStringAddressesSyncMap constructs a new SyncMap

func (*StringAddressesSyncMap) Delete

func (m *StringAddressesSyncMap) Delete(k string)

Delete -

func (*StringAddressesSyncMap) Get

Get -

func (*StringAddressesSyncMap) Put

func (m *StringAddressesSyncMap) Put(k string, v *Addresses)

Put -

func (*StringAddressesSyncMap) Range

func (m *StringAddressesSyncMap) Range(i func(k string, v *Addresses) bool)

Range -

type StringSyncList

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

StringSyncList -

func NewStringValueTypeSyncMap

func NewStringValueTypeSyncMap() *StringSyncList

NewStringValueTypeSyncMap constructs a new SyncMap

func (*StringSyncList) Delete

func (m *StringSyncList) Delete(k string)

Delete -

func (*StringSyncList) Exists

func (m *StringSyncList) Exists(k string) bool

Exists -

func (*StringSyncList) Put

func (m *StringSyncList) Put(k string)

Put -

func (*StringSyncList) Range

func (m *StringSyncList) Range(i func(k string) bool)

Range -

type Updated

type Updated struct {
	Addresses []string            `json:"addresses:as"`
	Signature *crypto.Signature   `json:"@signature:o"`
	Authors   []*crypto.PublicKey `json:"@authors:ao"`
}

func (*Updated) EventName

func (e *Updated) EventName() string

func (*Updated) FromObject

func (e *Updated) FromObject(o object.Object) error

func (*Updated) GetType

func (e *Updated) GetType() string

func (*Updated) ToObject

func (e *Updated) ToObject() object.Object

Jump to

Keyboard shortcuts

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