syncpeer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCertificate

func AppendCertificate(cert []byte) bool

AppendCertificate append cert

func GetHTTPClient added in v1.0.2

func GetHTTPClient() *http.Client

GetHTTPClient get http client

func GetPeerURL

func GetPeerURL(publicKey []byte) (string, error)

GetPeerURL get url

func GetPeers

func GetPeers() []string

GetPeers get peers

func GetPublicKeysFromOtherNode

func GetPublicKeysFromOtherNode(url string, publicKey []byte) ([][]byte, []string, error)

GetPublicKeysFromOtherNode get pub from other nodes

func PeerAdd

func PeerAdd(url string)

PeerAdd add peer url

func SetHostURL added in v1.0.2

func SetHostURL(url string)

SetHostURL set host

func StartSync

func StartSync()

StartSync start sync

Types

type PartyInfoRequest

type PartyInfoRequest struct {
	SenderURL   string `json:"url"`
	SenderKey   string `json:"key"`
	SenderNonce string `json:"nonce"`
}

PartyInfoRequest used to marshal/unmarshal json

type PartyInfoResponse

type PartyInfoResponse struct {
	PublicKeys []ProvenPublicKey `json:"publicKeys"`
	PeerURLs   []string          `json:"peers"`
}

PartyInfoResponse used to marshal/unmarshal json

type Peer

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

Peer used to marshal/unmarshal json

type ProvenPublicKey

type ProvenPublicKey struct {
	Key   string `json:"key"`
	Proof string `json:"proof"`
}

ProvenPublicKey used to marshal/unmarshal json

type SafePublicKeyMap

type SafePublicKeyMap struct {
	sync2.RWMutex
	// contains filtered or unexported fields
}

SafePublicKeyMap used to marshal/unmarshal json

func NewSafePublicKeyMap

func NewSafePublicKeyMap() *SafePublicKeyMap

NewSafePublicKeyMap create new key

func (*SafePublicKeyMap) Delete

func (spm *SafePublicKeyMap) Delete(key string)

Delete will delete internal key

func (*SafePublicKeyMap) Get

func (spm *SafePublicKeyMap) Get(key string) (value *Peer)

Get will get internal key

func (*SafePublicKeyMap) Store

func (spm *SafePublicKeyMap) Store(key string, value *Peer)

Store will store key

Jump to

Keyboard shortcuts

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