Documentation ¶
Index ¶
- func WithSeedNodes(visit func(ServiceNode))
- type ServiceNode
- func (node *ServiceNode) FetchMessages(sessionID string, lastHash string) ([]model.Message, error)
- func (node *ServiceNode) GetSNodeList() ([]ServiceNode, error)
- func (node *ServiceNode) RPCURL() *url.URL
- func (node *ServiceNode) SNodeAddr() string
- func (node *ServiceNode) StorageAPI(method string, params map[string]interface{}) (result map[string]interface{}, err error)
- func (node *ServiceNode) StorageURL() *url.URL
- func (node *ServiceNode) StoreMessage(sessionID string, msg model.Message) (*ServiceNode, error)
- func (node *ServiceNode) TLSConfig() *tls.Config
- func (node *ServiceNode) URL(path string) *url.URL
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 (*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
Click to show internal directories.
Click to hide internal directories.