Documentation ¶
Index ¶
- Variables
- type Server
- func (dht *Server) Addr() string
- func (dht *Server) Announce(objType int, repo string, key []byte, doneCB func(error)) bool
- func (dht *Server) Bootstrap() (err error)
- func (dht *Server) DHT() *kaddht.IpfsDHT
- func (dht *Server) GetProviders(ctx context.Context, key []byte) ([]peer.AddrInfo, error)
- func (dht *Server) Host() host.Host
- func (dht *Server) Lookup(ctx context.Context, key string) ([]byte, error)
- func (dht *Server) NewAnnouncerSession() dht3.Session
- func (dht *Server) ObjectStreamer() dht3.Streamer
- func (dht *Server) Peers() (peers []string)
- func (dht *Server) RegisterChecker(objType int, f dht3.CheckFunc)
- func (dht *Server) Start() error
- func (dht *Server) Stop() (err error)
- func (dht *Server) Store(ctx context.Context, key string, value []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProtocolPrefix = kaddht.ProtocolPrefix("/mos-dht") ConnectTickerInterval = 5 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides distributed hash table functionalities.
func New ¶
func New(ctx context.Context, host kitnet.Host, keepers core.Keepers, cfg *config.AppConfig) (*Server, error)
New creates a new Server
func (*Server) GetProviders ¶
GetRepoObjectProviders finds peers that have announced their readiness to provide a value for the given key.
func (*Server) NewAnnouncerSession ¶
NewAnnouncerSession creates an announcer session
func (*Server) ObjectStreamer ¶
ObjectStreamer returns the commit streamer
func (*Server) RegisterChecker ¶
RegisterChecker registers an object checker to the announcer.
Click to show internal directories.
Click to hide internal directories.