Documentation ¶
Index ¶
- type AddProviders
- type AddProvidersService
- type AddProvidersSpan
- type Connection
- type ConnectionService
- type ConnectionSpan
- type Dial
- type DialService
- type DialSpan
- type FindNodes
- type FindNodesService
- type FindNodesSpan
- type GetProviders
- type GetProvidersService
- type GetProvidersSpan
- type Host
- func (hs *Host) Archive(ctx context.Context, dbHost *models.Host) error
- func (hs *Host) Create(ctx context.Context, name string, network types.NetworkType) (*dht.Host, error)
- func (hs *Host) Host(ctx context.Context, p peer.ID) (*dht.Host, error)
- func (hs *Host) Hosts(ctx context.Context) (map[string]*dht.Host, models.HostSlice, error)
- func (hs *Host) Start(ctx context.Context, h *dht.Host) (*dht.Host, error)
- func (hs *Host) Stop(p peer.ID) error
- type HostService
- type Measurement
- type MeasurementService
- type MultiAddress
- type MultiAddressService
- type Peer
- func (ps *Peer) Find(ctx context.Context, p peer.ID) (*models.Peer, error)
- func (ps *Peer) UpsertLocalPeer(ctx context.Context, exec boil.ContextExecutor, h host.Host) (*models.Peer, error)
- func (ps *Peer) UpsertLocalPeerTxn(ctx context.Context, h host.Host) (*models.Peer, error)
- func (ps *Peer) UpsertPeer(ctx context.Context, exec boil.ContextExecutor, h host.Host, pid peer.ID) (*models.Peer, error)
- func (ps *Peer) UpsertPeerForInfo(ctx context.Context, exec boil.ContextExecutor, h host.Host, pid peer.ID, ...) (*models.Peer, error)
- type PeerInfo
- type PeerService
- type PeerState
- type PeerStateService
- type Provide
- func (ps *Provide) Get(ctx context.Context, h *dht.Host, provideID int) (*models.Provide, error)
- func (ps *Provide) GetByID(ctx context.Context, provideID int) (*models.Provide, error)
- func (ps *Provide) List(ctx context.Context, h *dht.Host) ([]*models.Provide, error)
- func (ps *Provide) Provide(ctx context.Context, h *dht.Host, opts ...ProvideOption) (*models.Provide, error)
- type ProvideConfig
- type ProvideOption
- type ProvideService
- type ProvideState
- func (ps *ProvideState) ClosedStream(network network.Network, stream network.Stream)
- func (ps *ProvideState) Connected(network network.Network, conn network.Conn)
- func (ps *ProvideState) DialEnded(trpt string, raddr ma.Multiaddr, p peer.ID, start time.Time, end time.Time, ...)
- func (ps *ProvideState) DialStarted(trpt string, raddr ma.Multiaddr, p peer.ID, start time.Time)
- func (ps *ProvideState) Disconnected(network network.Network, conn network.Conn)
- func (ps *ProvideState) Listen(network network.Network, multiaddr ma.Multiaddr)
- func (ps *ProvideState) ListenClose(network network.Network, multiaddr ma.Multiaddr)
- func (ps *ProvideState) OpenedStream(network network.Network, stream network.Stream)
- func (ps *ProvideState) PeerInfos() map[peer.ID]*PeerInfo
- func (ps *ProvideState) Register(ctx context.Context) context.Context
- func (ps *ProvideState) Unregister()
- type Retrieval
- type RetrievalService
- type RetrievalState
- func (rs *RetrievalState) ClosedStream(network network.Network, stream network.Stream)
- func (rs *RetrievalState) Connected(network network.Network, conn network.Conn)
- func (rs *RetrievalState) DialEnded(trpt string, raddr ma.Multiaddr, p peer.ID, start time.Time, end time.Time, ...)
- func (rs *RetrievalState) DialStarted(trpt string, raddr ma.Multiaddr, p peer.ID, start time.Time)
- func (rs *RetrievalState) Disconnected(network network.Network, conn network.Conn)
- func (rs *RetrievalState) Listen(network network.Network, multiaddr ma.Multiaddr)
- func (rs *RetrievalState) ListenClose(network network.Network, multiaddr ma.Multiaddr)
- func (rs *RetrievalState) OpenedStream(network network.Network, stream network.Stream)
- func (rs *RetrievalState) Register(ctx context.Context) context.Context
- func (rs *RetrievalState) Unregister()
- type RoutingTable
- func (rts *RoutingTable) Find(ctx context.Context, id int) (*models.RoutingTableSnapshot, error)
- func (rts *RoutingTable) FindAll(ctx context.Context, hostID peer.ID) ([]*models.RoutingTableSnapshot, error)
- func (rts *RoutingTable) FindByIDAndHostID(ctx context.Context, id int, hostID peer.ID) (*models.RoutingTableSnapshot, error)
- func (rts *RoutingTable) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host) (*models.RoutingTableSnapshot, error)
- func (rts *RoutingTable) SaveTxn(ctx context.Context, h *dht.Host) (*models.RoutingTableSnapshot, error)
- type RoutingTableListener
- func (r *RoutingTableListener) BuildUpdate() types.RoutingTablePeers
- func (r *RoutingTableListener) OnClose()
- func (r *RoutingTableListener) PeerAdded(p peer.ID)
- func (r *RoutingTableListener) PeerRemoved(p peer.ID)
- func (r *RoutingTableListener) SendFullUpdate()
- func (r *RoutingTableListener) Stop()
- func (r *RoutingTableListener) Updates() <-chan types.RoutingTableUpdate
- type RoutingTableService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddProviders ¶
type AddProviders struct {
// contains filtered or unexported fields
}
func (*AddProviders) List ¶
func (ap *AddProviders) List(ctx context.Context, provide *models.Provide) ([]*models.AddProviderRPC, error)
func (*AddProviders) Save ¶
func (ap *AddProviders) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, apReqs []*AddProvidersSpan, peerInfos map[peer.ID]*PeerInfo) (models.AddProviderRPCSlice, error)
type AddProvidersService ¶
type AddProvidersService interface { List(ctx context.Context, provide *models.Provide) ([]*models.AddProviderRPC, error) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, apReqs []*AddProvidersSpan, peerInfos map[peer.ID]*PeerInfo) (models.AddProviderRPCSlice, error) }
func NewAddProvidersService ¶
func NewAddProvidersService(peerService PeerService, maService MultiAddressService, apRepo repo.AddProvidersRepo, cpRepo repo.CloserPeersRepo) AddProvidersService
type AddProvidersSpan ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) List ¶
func (c *Connection) List(ctx context.Context, provide *models.Provide) (models.ConnectionSlice, error)
func (*Connection) Save ¶
func (c *Connection) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, conns []*ConnectionSpan, peerInfos map[peer.ID]*PeerInfo) (models.ConnectionSlice, error)
type ConnectionService ¶
type ConnectionService interface { List(ctx context.Context, provide *models.Provide) (models.ConnectionSlice, error) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, conns []*ConnectionSpan, peerInfos map[peer.ID]*PeerInfo) (models.ConnectionSlice, error) }
func NewConnectionService ¶
func NewConnectionService(peerService PeerService, maService MultiAddressService, repo repo.ConnectionRepo) ConnectionService
type ConnectionSpan ¶
type DialService ¶
type DialService interface { List(ctx context.Context, provide *models.Provide) (models.DialSlice, error) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, dials []*DialSpan, peerInfos map[peer.ID]*PeerInfo) (models.DialSlice, error) }
func NewDialService ¶
func NewDialService(peerService PeerService, maService MultiAddressService, dialRepo repo.DialRepo) DialService
type FindNodesService ¶
type FindNodesService interface {
Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, fnReqs []*FindNodesSpan, peerInfos map[peer.ID]*PeerInfo) (models.FindNodesRPCSlice, error)
}
func NewFindNodesService ¶
func NewFindNodesService(peerService PeerService, maService MultiAddressService, fnRepo repo.FindNodesRPCRepo, cpRepo repo.CloserPeersRepo) FindNodesService
type FindNodesSpan ¶
type GetProviders ¶
type GetProviders struct {
// contains filtered or unexported fields
}
func (*GetProviders) Save ¶
func (gp *GetProviders) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, gpReqs []*GetProvidersSpan) (models.GetProvidersRPCSlice, error)
type GetProvidersService ¶
type GetProvidersService interface {
Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, fnReqs []*GetProvidersSpan) (models.GetProvidersRPCSlice, error)
}
func NewGetProvidersService ¶
func NewGetProvidersService(peerService PeerService, maService MultiAddressService, gpRepo repo.GetProvidersRepo) GetProvidersService
type GetProvidersSpan ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
type HostService ¶
type HostService interface { Create(ctx context.Context, name string, network types.NetworkType) (*dht.Host, error) Hosts(ctx context.Context) (map[string]*dht.Host, models.HostSlice, error) Host(ctx context.Context, p peer.ID) (*dht.Host, error) Start(ctx context.Context, h *dht.Host) (*dht.Host, error) Stop(p peer.ID) error Archive(ctx context.Context, dbHost *models.Host) error }
func NewHostService ¶
func NewHostService(peerService PeerService, rtService RoutingTableService, hostRepo repo.HostRepo) HostService
type Measurement ¶
type Measurement struct {
// contains filtered or unexported fields
}
func NewProvideMeasurementService ¶
func NewProvideMeasurementService(ps ProvideService) *Measurement
func (*Measurement) StartProvide ¶
func (m *Measurement) StartProvide(ctx context.Context, h *dht.Host, config types.ProvideMeasurementConfiguration) (*models.Measurement, error)
func (*Measurement) Stop ¶
func (m *Measurement) Stop(measurementID int) error
type MeasurementService ¶
type MultiAddress ¶
type MultiAddress struct {
// contains filtered or unexported fields
}
func NewMultiAddressService ¶
func NewMultiAddressService(maRepo repo.MultiAddressRepo, iaRepo repo.IPAddressRepo) *MultiAddress
func (*MultiAddress) UpsertMultiAddress ¶
func (ma *MultiAddress) UpsertMultiAddress(ctx context.Context, exec boil.ContextExecutor, maddr ma.Multiaddr) (*models.MultiAddress, error)
func (*MultiAddress) UpsertMultiAddresses ¶
func (ma *MultiAddress) UpsertMultiAddresses(ctx context.Context, exec boil.ContextExecutor, maddrs []ma.Multiaddr) ([]int64, error)
type MultiAddressService ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) UpsertLocalPeer ¶
func (*Peer) UpsertLocalPeerTxn ¶
func (*Peer) UpsertPeer ¶
type PeerService ¶
type PeerService interface { Find(ctx context.Context, p peer.ID) (*models.Peer, error) UpsertLocalPeer(ctx context.Context, exec boil.ContextExecutor, h host.Host) (*models.Peer, error) UpsertLocalPeerTxn(ctx context.Context, h host.Host) (*models.Peer, error) UpsertPeer(ctx context.Context, exec boil.ContextExecutor, h host.Host, pid peer.ID) (*models.Peer, error) UpsertPeerForInfo(ctx context.Context, exec boil.ContextExecutor, h host.Host, pid peer.ID, pi *PeerInfo) (*models.Peer, error) }
func NewPeerService ¶
func NewPeerService(repo repo.PeerRepo) PeerService
type PeerStateService ¶
type PeerStateService interface {
Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host, uuid uuid.UUID, states []qpeerset.QueryPeerState) (models.PeerStateSlice, error)
}
func NewPeerStateService ¶
func NewPeerStateService(peerService PeerService, psRepo repo.PeerStateRepo) PeerStateService
type Provide ¶
type Provide struct {
// contains filtered or unexported fields
}
func NewProvideService ¶
func NewProvideService(peerService PeerService, hostService HostService, rtService RoutingTableService, maService MultiAddressService, dialService DialService, connService ConnectionService, fnService FindNodesService, psService PeerStateService, apService AddProvidersService, provideRepo repo.ProvideRepo) *Provide
type ProvideConfig ¶
type ProvideConfig struct { Sync bool Type types.ProvideType MeasurementID int MultiQueryConcurrency int }
func (*ProvideConfig) Apply ¶
func (cfg *ProvideConfig) Apply(opts ...ProvideOption) error
Apply applies the given options to the config, returning the first error encountered (if any).
type ProvideOption ¶
type ProvideOption func(cfg *ProvideConfig) error
func ProvideMeasurementID ¶
func ProvideMeasurementID(id int) ProvideOption
func ProvideMultiQueryConcurrency ¶
func ProvideMultiQueryConcurrency(concurrency int) ProvideOption
func ProvideSync ¶
func ProvideSync() ProvideOption
func ProvideType ¶
func ProvideType(t types.ProvideType) ProvideOption
type ProvideService ¶
type ProvideService interface { Provide(ctx context.Context, h *dht.Host, opts ...ProvideOption) (*models.Provide, error) List(ctx context.Context, h *dht.Host) ([]*models.Provide, error) Get(ctx context.Context, h *dht.Host, id int) (*models.Provide, error) GetByID(ctx context.Context, id int) (*models.Provide, error) }
type ProvideState ¶
type ProvideState struct {
// contains filtered or unexported fields
}
func NewProvideState ¶
func NewProvideState(h *dht.Host, content *util.Content) *ProvideState
func (*ProvideState) ClosedStream ¶
func (ps *ProvideState) ClosedStream(network network.Network, stream network.Stream)
func (*ProvideState) Connected ¶
func (ps *ProvideState) Connected(network network.Network, conn network.Conn)
func (*ProvideState) DialStarted ¶
func (*ProvideState) Disconnected ¶
func (ps *ProvideState) Disconnected(network network.Network, conn network.Conn)
func (*ProvideState) Listen ¶
func (ps *ProvideState) Listen(network network.Network, multiaddr ma.Multiaddr)
func (*ProvideState) ListenClose ¶
func (ps *ProvideState) ListenClose(network network.Network, multiaddr ma.Multiaddr)
func (*ProvideState) OpenedStream ¶
func (ps *ProvideState) OpenedStream(network network.Network, stream network.Stream)
func (*ProvideState) Register ¶
func (ps *ProvideState) Register(ctx context.Context) context.Context
func (*ProvideState) Unregister ¶
func (ps *ProvideState) Unregister()
type Retrieval ¶
type Retrieval struct {
// contains filtered or unexported fields
}
func NewRetrievalService ¶
func NewRetrievalService(hostService HostService, rtService RoutingTableService, dialService DialService, connService ConnectionService, gpService GetProvidersService, psService PeerStateService, retrievalRepo repo.RetrievalRepo) *Retrieval
type RetrievalService ¶
type RetrievalState ¶
type RetrievalState struct {
// contains filtered or unexported fields
}
func NewRetrievalState ¶
func NewRetrievalState(h *dht.Host, contentID cid.Cid) *RetrievalState
func (*RetrievalState) ClosedStream ¶
func (rs *RetrievalState) ClosedStream(network network.Network, stream network.Stream)
func (*RetrievalState) Connected ¶
func (rs *RetrievalState) Connected(network network.Network, conn network.Conn)
func (*RetrievalState) DialStarted ¶
func (*RetrievalState) Disconnected ¶
func (rs *RetrievalState) Disconnected(network network.Network, conn network.Conn)
func (*RetrievalState) Listen ¶
func (rs *RetrievalState) Listen(network network.Network, multiaddr ma.Multiaddr)
func (*RetrievalState) ListenClose ¶
func (rs *RetrievalState) ListenClose(network network.Network, multiaddr ma.Multiaddr)
func (*RetrievalState) OpenedStream ¶
func (rs *RetrievalState) OpenedStream(network network.Network, stream network.Stream)
func (*RetrievalState) Register ¶
func (rs *RetrievalState) Register(ctx context.Context) context.Context
func (*RetrievalState) Unregister ¶
func (rs *RetrievalState) Unregister()
type RoutingTable ¶
type RoutingTable struct {
// contains filtered or unexported fields
}
func (*RoutingTable) Find ¶
func (rts *RoutingTable) Find(ctx context.Context, id int) (*models.RoutingTableSnapshot, error)
func (*RoutingTable) FindAll ¶
func (rts *RoutingTable) FindAll(ctx context.Context, hostID peer.ID) ([]*models.RoutingTableSnapshot, error)
func (*RoutingTable) FindByIDAndHostID ¶
func (rts *RoutingTable) FindByIDAndHostID(ctx context.Context, id int, hostID peer.ID) (*models.RoutingTableSnapshot, error)
func (*RoutingTable) Save ¶
func (rts *RoutingTable) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host) (*models.RoutingTableSnapshot, error)
func (*RoutingTable) SaveTxn ¶
func (rts *RoutingTable) SaveTxn(ctx context.Context, h *dht.Host) (*models.RoutingTableSnapshot, error)
type RoutingTableListener ¶
type RoutingTableListener struct {
// contains filtered or unexported fields
}
func NewRoutingTableListener ¶
func NewRoutingTableListener(h *dht.Host) *RoutingTableListener
func (*RoutingTableListener) BuildUpdate ¶
func (r *RoutingTableListener) BuildUpdate() types.RoutingTablePeers
func (*RoutingTableListener) OnClose ¶
func (r *RoutingTableListener) OnClose()
func (*RoutingTableListener) PeerAdded ¶
func (r *RoutingTableListener) PeerAdded(p peer.ID)
func (*RoutingTableListener) PeerRemoved ¶
func (r *RoutingTableListener) PeerRemoved(p peer.ID)
func (*RoutingTableListener) SendFullUpdate ¶
func (r *RoutingTableListener) SendFullUpdate()
func (*RoutingTableListener) Stop ¶
func (r *RoutingTableListener) Stop()
func (*RoutingTableListener) Updates ¶
func (r *RoutingTableListener) Updates() <-chan types.RoutingTableUpdate
type RoutingTableService ¶
type RoutingTableService interface { Find(ctx context.Context, id int) (*models.RoutingTableSnapshot, error) FindAll(ctx context.Context, hostID peer.ID) ([]*models.RoutingTableSnapshot, error) FindByIDAndHostID(ctx context.Context, id int, hostID peer.ID) (*models.RoutingTableSnapshot, error) Save(ctx context.Context, exec boil.ContextExecutor, h *dht.Host) (*models.RoutingTableSnapshot, error) SaveTxn(ctx context.Context, h *dht.Host) (*models.RoutingTableSnapshot, error) }
func NewRoutingTableService ¶
func NewRoutingTableService(peerService PeerService, rtRepo repo.RoutingTableRepo) RoutingTableService
Source Files ¶
Click to show internal directories.
Click to hide internal directories.