Documentation
¶
Index ¶
- func PullData(ctx context.Context, client *http.Client, edge *types.Edge, cid string, ...) (int64, []byte, error)
- type ReaderStream
- type Service
- func (s *Service) Close() error
- func (s *Service) Discover() (t types.NATType, e error)
- func (s *Service) EndOfFile() error
- func (s *Service) FilterAccessibleNodes(ctx context.Context, edges []*types.Edge) (map[string]*types.Client, error)
- func (s *Service) GetAccessibleEdges(ctx context.Context, cid cid.Cid) (map[string]*types.Client, error)
- func (s *Service) GetBlock(ctx context.Context, cid cid.Cid) (blocks.Block, error)
- func (s *Service) GetCandidates(schedulerURL string) ([]string, error)
- func (s *Service) GetDefaultClient() *http.Client
- func (s *Service) GetEdgeNodesByFile(cid cid.Cid) ([]*types.Edge, error)
- func (s *Service) GetPublicAddress(schedulerURL string) (types.Host, error)
- func (s *Service) GetRange(ctx context.Context, c *types.Client, cid cid.Cid, start, end int64) (int64, []byte, error)
- func (s *Service) GetSchedulers() ([]string, error)
- func (s *Service) GroupByEdges(ctx context.Context, cid cid.Cid) ([]*types.Edge, []*types.Edge, error)
- func (s *Service) NatPunching(edge *types.Edge) error
- func (s *Service) RequestCandidateToSendPackets(remoteAddr string, network, url string) error
- func (s *Service) SubmitProofOfWork(schedulerAddr string, data []byte) error
- func (s *Service) Version(client *http.Client, remoteAddr string) error
- type Strategy
- type StreamType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ReaderStream ¶
type ReaderStream struct { Type StreamType Info string }
ReaderStream indicating the uuid of push request, ex: `ReaderStream{ Type: "push", Info: "[UUID string]" }
See https://github.com/Filecoin-Titan/titan/blob/main/lib/rpcenc/reader.go#L50
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) FilterAccessibleNodes ¶
func (s *Service) FilterAccessibleNodes(ctx context.Context, edges []*types.Edge) (map[string]*types.Client, error)
FilterAccessibleNodes filtering out the list of available edges to only include those that are accessible by the client and added to the list of accessible accessibleEdges.
func (*Service) GetAccessibleEdges ¶
func (*Service) GetCandidates ¶
GetCandidates get candidates list in the same region
func (*Service) GetDefaultClient ¶
func (*Service) GetEdgeNodesByFile ¶
func (*Service) GetPublicAddress ¶
GetPublicAddress return the public address
func (*Service) GetRange ¶
func (s *Service) GetRange(ctx context.Context, c *types.Client, cid cid.Cid, start, end int64) (int64, []byte, error)
GetRange retrieves specific byte ranges of UnixFS files and raw blocks.
func (*Service) GetSchedulers ¶
GetSchedulers get scheduler list in the same region
func (*Service) GroupByEdges ¶
func (*Service) NatPunching ¶
NatPunching creates a connection from edge node side for the application via the scheduler
func (*Service) RequestCandidateToSendPackets ¶
RequestCandidateToSendPackets sends packet from server side to determine the application connectivity
func (*Service) SubmitProofOfWork ¶
SubmitProofOfWork submits a proof of work for a downloaded file
type StreamType ¶
type StreamType string
const ( Null StreamType = "null" PushStream StreamType = "push" )