Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Defaults = func(o *Options) error { o.Validator = record.NamespacedValidator{ "pk": record.PublicKeyValidator{}, } o.Datastore = dssync.MutexWrap(ds.NewMapDatastore()) return nil }
Defaults are the default DHT options. This option will be automatically prepended to any options you pass to the DHT constructor.
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`.