Documentation
¶
Index ¶
- Variables
- type HTTPServiceDefault
- type MediatorDefault
- func (m MediatorDefault) AddPeer(peer net.Peer) error
- func (m MediatorDefault) AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, ...) error
- func (m MediatorDefault) ConnectToNode(connectionUris []*url.URL, retried bool, fromPeer net.Peer) error
- func (m MediatorDefault) GetCachedStorageLocations(hash *encoding.Multihash, kinds []types.StorageLocationType) (map[string]storage.StorageLocation, error)
- func (m MediatorDefault) HashQueryRoutingTable() structs.Map
- func (m MediatorDefault) NetworkId() string
- func (m MediatorDefault) NodeId() *encoding.NodeId
- func (m MediatorDefault) Peers() structs.Map
- func (m MediatorDefault) ProviderStore() storage.ProviderStore
- func (m MediatorDefault) RegistryGet(pk []byte) (protocol.SignedRegistryEntry, error)
- func (m MediatorDefault) RegistrySet(sre protocol.SignedRegistryEntry, trusted bool, receivedFrom net.Peer) error
- func (m MediatorDefault) SelfConnectionUris() []*url.URL
- func (m MediatorDefault) SendPublicPeersToPeer(peer net.Peer, peersToSend []net.Peer) error
- func (m MediatorDefault) ServicesStarted() bool
- func (m MediatorDefault) SignMessageSimple(message []byte) ([]byte, error)
- func (m MediatorDefault) SortNodesByScore(nodes []*encoding.NodeId) ([]*encoding.NodeId, error)
- type P2PNodeResponse
- type P2PNodesResponse
- type P2PServiceDefault
- func (p *P2PServiceDefault) AddPeer(peer net.Peer) error
- func (p *P2PServiceDefault) ConnectToNode(connectionUris []*url.URL, retry uint, fromPeer net.Peer) error
- func (p *P2PServiceDefault) ConnectionTracker() *sync.WaitGroup
- func (p *P2PServiceDefault) DownVote(nodeId *encoding.NodeId) error
- func (p *P2PServiceDefault) GetNodeScore(nodeId *encoding.NodeId) (float64, error)
- func (n *P2PServiceDefault) HashQueryRoutingTable() structs.Map
- func (p *P2PServiceDefault) Init(ctx context.Context) error
- func (p *P2PServiceDefault) NetworkId() string
- func (p *P2PServiceDefault) NodeId() *encoding.NodeId
- func (p *P2PServiceDefault) OnNewPeer(peer net.Peer, verifyId bool) error
- func (p *P2PServiceDefault) OnNewPeerListen(peer net.Peer, verifyId bool)
- func (p *P2PServiceDefault) Peers() structs.Map
- func (p *P2PServiceDefault) SelfConnectionUris() []*url.URL
- func (p *P2PServiceDefault) SendHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) error
- func (p *P2PServiceDefault) SendPublicPeersToPeer(peer net.Peer, peersToSend []net.Peer) error
- func (p *P2PServiceDefault) SignMessageSimple(message []byte) ([]byte, error)
- func (p *P2PServiceDefault) SortNodesByScore(nodes []*encoding.NodeId) ([]*encoding.NodeId, error)
- func (p *P2PServiceDefault) Start(ctx context.Context) error
- func (p *P2PServiceDefault) Stop(ctx context.Context) error
- func (p *P2PServiceDefault) UpVote(nodeId *encoding.NodeId) error
- func (p *P2PServiceDefault) WaitOnConnectedPeers()
- type RegistryServiceDefault
- func (r *RegistryServiceDefault) BroadcastEntry(sre protocol.SignedRegistryEntry, receivedFrom net.Peer) error
- func (r *RegistryServiceDefault) Get(pk []byte) (protocol.SignedRegistryEntry, error)
- func (r *RegistryServiceDefault) Init(ctx context.Context) error
- func (r *RegistryServiceDefault) Listen(pk []byte, cb func(sre protocol.SignedRegistryEntry)) (func(), error)
- func (r *RegistryServiceDefault) SendRegistryRequest(pk []byte) error
- func (r *RegistryServiceDefault) Set(sre protocol.SignedRegistryEntry, trusted bool, receivedFrom net.Peer) error
- func (r *RegistryServiceDefault) Start(ctx context.Context) error
- func (r *RegistryServiceDefault) Stop(ctx context.Context) error
- type StorageService
- func (s *StorageService) AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, ...) error
- func (s *StorageService) DownloadBytesByCID(cid *encoding.CID) (bytes []byte, err error)
- func (s *StorageService) DownloadBytesByHash(hash *encoding.Multihash) ([]byte, error)
- func (s *StorageService) GetCachedStorageLocations(hash *encoding.Multihash, kinds []types.StorageLocationType, local bool) (map[string]storage.StorageLocation, error)
- func (s *StorageService) GetMetadataByCID(cid *encoding.CID) (md metadata.Metadata, err error)
- func (s *StorageService) Init(ctx context.Context) error
- func (s *StorageService) ParseMetadata(bytes []byte, cid *encoding.CID) (metadata.Metadata, error)
- func (n *StorageService) ProviderStore() storage.ProviderStore
- func (n *StorageService) SetProviderStore(store storage.ProviderStore)
- func (s *StorageService) Start(ctx context.Context) error
- func (s *StorageService) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedMetaFormat = errors.New("unsupported metadata format")
)
Functions ¶
This section is empty.
Types ¶
type HTTPServiceDefault ¶
type HTTPServiceDefault struct {
service.ServiceBase
}
func NewHTTP ¶
func NewHTTP(params service.ServiceParams) *HTTPServiceDefault
func (*HTTPServiceDefault) GetHttpRouter ¶
func (h *HTTPServiceDefault) GetHttpRouter() map[string]http.HandlerFunc
type MediatorDefault ¶
type MediatorDefault struct {
service.ServiceBase
}
func NewMediator ¶
func NewMediator(params service.ServiceParams) *MediatorDefault
func (MediatorDefault) AddStorageLocation ¶
func (m MediatorDefault) AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, location storage.StorageLocation, message []byte) error
func (MediatorDefault) ConnectToNode ¶
func (MediatorDefault) GetCachedStorageLocations ¶
func (m MediatorDefault) GetCachedStorageLocations(hash *encoding.Multihash, kinds []types.StorageLocationType) (map[string]storage.StorageLocation, error)
func (MediatorDefault) HashQueryRoutingTable ¶
func (m MediatorDefault) HashQueryRoutingTable() structs.Map
func (MediatorDefault) NetworkId ¶
func (m MediatorDefault) NetworkId() string
func (MediatorDefault) NodeId ¶
func (m MediatorDefault) NodeId() *encoding.NodeId
func (MediatorDefault) Peers ¶
func (m MediatorDefault) Peers() structs.Map
func (MediatorDefault) ProviderStore ¶
func (m MediatorDefault) ProviderStore() storage.ProviderStore
func (MediatorDefault) RegistryGet ¶
func (m MediatorDefault) RegistryGet(pk []byte) (protocol.SignedRegistryEntry, error)
func (MediatorDefault) RegistrySet ¶
func (m MediatorDefault) RegistrySet(sre protocol.SignedRegistryEntry, trusted bool, receivedFrom net.Peer) error
func (MediatorDefault) SelfConnectionUris ¶
func (m MediatorDefault) SelfConnectionUris() []*url.URL
func (MediatorDefault) SendPublicPeersToPeer ¶
func (MediatorDefault) ServicesStarted ¶
func (m MediatorDefault) ServicesStarted() bool
func (MediatorDefault) SignMessageSimple ¶
func (m MediatorDefault) SignMessageSimple(message []byte) ([]byte, error)
func (MediatorDefault) SortNodesByScore ¶
type P2PNodeResponse ¶
type P2PNodesResponse ¶
type P2PNodesResponse struct {
Nodes []P2PNodeResponse `json:"nodes"`
}
type P2PServiceDefault ¶
type P2PServiceDefault struct { service.ServiceBase // contains filtered or unexported fields }
func NewP2P ¶
func NewP2P(params service.ServiceParams) *P2PServiceDefault
func (*P2PServiceDefault) ConnectToNode ¶
func (*P2PServiceDefault) ConnectionTracker ¶
func (p *P2PServiceDefault) ConnectionTracker() *sync.WaitGroup
func (*P2PServiceDefault) DownVote ¶
func (p *P2PServiceDefault) DownVote(nodeId *encoding.NodeId) error
func (*P2PServiceDefault) GetNodeScore ¶
func (p *P2PServiceDefault) GetNodeScore(nodeId *encoding.NodeId) (float64, error)
func (*P2PServiceDefault) HashQueryRoutingTable ¶
func (n *P2PServiceDefault) HashQueryRoutingTable() structs.Map
func (*P2PServiceDefault) NetworkId ¶
func (p *P2PServiceDefault) NetworkId() string
func (*P2PServiceDefault) NodeId ¶
func (p *P2PServiceDefault) NodeId() *encoding.NodeId
func (*P2PServiceDefault) OnNewPeer ¶
func (p *P2PServiceDefault) OnNewPeer(peer net.Peer, verifyId bool) error
func (*P2PServiceDefault) OnNewPeerListen ¶
func (p *P2PServiceDefault) OnNewPeerListen(peer net.Peer, verifyId bool)
func (*P2PServiceDefault) Peers ¶
func (p *P2PServiceDefault) Peers() structs.Map
func (*P2PServiceDefault) SelfConnectionUris ¶
func (p *P2PServiceDefault) SelfConnectionUris() []*url.URL
func (*P2PServiceDefault) SendHashRequest ¶
func (p *P2PServiceDefault) SendHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) error
func (*P2PServiceDefault) SendPublicPeersToPeer ¶
func (*P2PServiceDefault) SignMessageSimple ¶
func (p *P2PServiceDefault) SignMessageSimple(message []byte) ([]byte, error)
func (*P2PServiceDefault) SortNodesByScore ¶
func (*P2PServiceDefault) UpVote ¶
func (p *P2PServiceDefault) UpVote(nodeId *encoding.NodeId) error
func (*P2PServiceDefault) WaitOnConnectedPeers ¶
func (p *P2PServiceDefault) WaitOnConnectedPeers()
type RegistryServiceDefault ¶
type RegistryServiceDefault struct { service.ServiceBase // contains filtered or unexported fields }
func NewRegistry ¶
func NewRegistry(params service.ServiceParams) *RegistryServiceDefault
func (*RegistryServiceDefault) BroadcastEntry ¶
func (r *RegistryServiceDefault) BroadcastEntry(sre protocol.SignedRegistryEntry, receivedFrom net.Peer) error
func (*RegistryServiceDefault) Get ¶
func (r *RegistryServiceDefault) Get(pk []byte) (protocol.SignedRegistryEntry, error)
func (*RegistryServiceDefault) Init ¶
func (r *RegistryServiceDefault) Init(ctx context.Context) error
func (*RegistryServiceDefault) Listen ¶
func (r *RegistryServiceDefault) Listen(pk []byte, cb func(sre protocol.SignedRegistryEntry)) (func(), error)
func (*RegistryServiceDefault) SendRegistryRequest ¶
func (r *RegistryServiceDefault) SendRegistryRequest(pk []byte) error
func (*RegistryServiceDefault) Set ¶
func (r *RegistryServiceDefault) Set(sre protocol.SignedRegistryEntry, trusted bool, receivedFrom net.Peer) error
type StorageService ¶
type StorageService struct { service.ServiceBase // contains filtered or unexported fields }
func NewStorage ¶
func NewStorage(params service.ServiceParams) *StorageService
func (*StorageService) AddStorageLocation ¶
func (s *StorageService) AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, location storage.StorageLocation, message []byte) error
func (*StorageService) DownloadBytesByCID ¶
func (s *StorageService) DownloadBytesByCID(cid *encoding.CID) (bytes []byte, err error)
func (*StorageService) DownloadBytesByHash ¶
func (s *StorageService) DownloadBytesByHash(hash *encoding.Multihash) ([]byte, error)
func (*StorageService) GetCachedStorageLocations ¶
func (s *StorageService) GetCachedStorageLocations(hash *encoding.Multihash, kinds []types.StorageLocationType, local bool) (map[string]storage.StorageLocation, error)
func (*StorageService) GetMetadataByCID ¶
func (*StorageService) ParseMetadata ¶
func (*StorageService) ProviderStore ¶
func (n *StorageService) ProviderStore() storage.ProviderStore
func (*StorageService) SetProviderStore ¶
func (n *StorageService) SetProviderStore(store storage.ProviderStore)
Click to show internal directories.
Click to hide internal directories.