net

package
Version: v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const KeyCachePrefix = "PUBKEYCACHE_"

Variables

View Source
var ErrFetching = errors.New("retriever already fetching")
View Source
var ErrPinRequestEmpty = errors.New("pin request empty response")
View Source
var ErrPinRequestMismatch = errors.New("pin request content id mismatch")
View Source
var ErrTokenExpired = errors.New("token expired")

Functions

func Pin

func Pin(ipfs *core.IpfsNode, id string, tokens *repo.CafeTokens, url string) error

Types

type MRConfig

type MRConfig struct {
	Datastore repo.Datastore
	Ipfs      *core.IpfsNode
	Service   NetworkService
	PrefixLen int
	SendAck   func(peerId string, pointerID peer.ID) error
	SendError func(peerId string, k *libp2pc.PubKey, errorMessage pb.Envelope) error
}

type MessageRetriever

type MessageRetriever struct {
	DoneChan chan struct{}
	// contains filtered or unexported fields
}

func NewMessageRetriever

func NewMessageRetriever(config MRConfig) *MessageRetriever

func (*MessageRetriever) FetchPointers

func (m *MessageRetriever) FetchPointers() error

func (*MessageRetriever) IsFetching

func (m *MessageRetriever) IsFetching() bool

func (*MessageRetriever) Run

func (m *MessageRetriever) Run()

type NetworkService

type NetworkService interface {
	HandleNewStream(s inet.Stream)
	HandlerForMsgType(t pb.Message_Type) func(peer.ID, *pb.Envelope, interface{}) (*pb.Envelope, error)
	SendRequest(ctx context.Context, p peer.ID, pmes *pb.Envelope) (*pb.Envelope, error)
	SendMessage(ctx context.Context, p peer.ID, pmes *pb.Envelope) error
	DisconnectFromPeer(p peer.ID) error
}

type Pinner

type Pinner struct {
	// contains filtered or unexported fields
}

func NewPinner

func NewPinner(config *PinnerConfig) *Pinner

func (*Pinner) Pin

func (p *Pinner) Pin()

func (*Pinner) Put

func (p *Pinner) Put(id string) error

func (*Pinner) Run

func (p *Pinner) Run()

func (*Pinner) Url

func (p *Pinner) Url() string

type PinnerConfig

type PinnerConfig struct {
	Datastore repo.Datastore
	Ipfs      func() *core.IpfsNode
	Url       string
	GetTokens func(bool) (*repo.CafeTokens, error)
}

type PointerRepublisher

type PointerRepublisher struct {
	// contains filtered or unexported fields
}

func NewPointerRepublisher

func NewPointerRepublisher(node *core.IpfsNode, datastore repo.Datastore) *PointerRepublisher

func (*PointerRepublisher) Republish

func (r *PointerRepublisher) Republish()

func (*PointerRepublisher) Run

func (r *PointerRepublisher) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL