Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultProtocols = []protocol.ID{ProtocolDHT, ProtocolDHTOld}
var Defaults = func(o *Options) error { o.Validator = record.NamespacedValidator{ "pk": record.PublicKeyValidator{}, } o.Datastore = dssync.MutexWrap(ds.NewMapDatastore()) o.Protocols = DefaultProtocols return nil }
Defaults are the default DHT options. This option will be automatically prepended to any options you pass to the DHT constructor.
var ProtocolDHT protocol.ID = "/ipfs/kad/1.0.0"
var ProtocolDHTOld protocol.ID = "/ipfs/dht"
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option DHT option type.
func Client ¶
Client configures whether or not the DHT operates in client-only mode.
Defaults to false.
func Datastore ¶
Datastore configures the DHT to use the specified datastore.
Defaults to an in-memory (temporary) map.
func NamespacedValidator ¶
NamespacedValidator adds a validator namespaced under `ns`. This option fails if the DHT is not using a `record.NamespacedValidator` as it's validator (it uses one by default but this can be overridden with the `Validator` option).
Example: Given a validator registered as `NamespacedValidator("ipns", myValidator)`, all records with keys starting with `/ipns/` will be validated with `myValidator`.