swarm

package
v0.0.0-...-8204e9e Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSeedNodes

func WithSeedNodes(visit func(ServiceNode))

Types

type ServiceNode

type ServiceNode struct {
	RemoteIP      string `json:"public_ip"`
	StoragePort   int    `json:"storage_port"`
	IdentityKey   string `json:"pubkey_ed25519"`
	EncryptionKey string `json:"pubkey_x25519"`
	SwarmID       uint64 `json:"swarm_id"`
}

func GetSwarmForPubkey

func GetSwarmForPubkey(snodes []ServiceNode, pk string) (swarm []ServiceNode)

/ GetSwarmForPubkey gets the swarm the public key belongs in

func (*ServiceNode) FetchMessages

func (node *ServiceNode) FetchMessages(sessionID string, lastHash string) ([]model.Message, error)

func (*ServiceNode) GetSNodeList

func (node *ServiceNode) GetSNodeList() ([]ServiceNode, error)

/ GetSNodeList fetches from this service node a list of all known service nodes

func (*ServiceNode) RPCURL

func (node *ServiceNode) RPCURL() *url.URL

func (*ServiceNode) SNodeAddr

func (node *ServiceNode) SNodeAddr() string

func (*ServiceNode) StorageAPI

func (node *ServiceNode) StorageAPI(method string, params map[string]interface{}) (result map[string]interface{}, err error)

func (*ServiceNode) StorageURL

func (node *ServiceNode) StorageURL() *url.URL

func (*ServiceNode) StoreMessage

func (node *ServiceNode) StoreMessage(sessionID string, msg model.Message) (*ServiceNode, error)

func (*ServiceNode) TLSConfig

func (node *ServiceNode) TLSConfig() *tls.Config

func (*ServiceNode) URL

func (node *ServiceNode) URL(path string) *url.URL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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