Documentation
¶
Index ¶
- Variables
- type Option
- func Addr(addr multiaddr.Multiaddr) Option
- func BootstrapPeers(addrs []multiaddr.Multiaddr) Option
- func BucketSize(bucketSize int) Option
- func Datastore(ds ds.Batching) Option
- func IDGenerator(g idgen.IdentityGenerator) Option
- func Limiter(l chan struct{}) Option
- func ProtocolPrefix(pfx protocol.ID) Option
- func Relay(relay bool) Option
- func RoutingTable(rt *kbucket.RoutingTable) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
var Defaults = func(o *Options) error { o.Datastore = dssync.MutexWrap(ds.NewMapDatastore()) o.Relay = false o.Addr, _ = multiaddr.NewMultiaddr("/ip4/0.0.0.0/tcp/0") o.ProtocolPrefix = dht.DefaultPrefix o.BucketSize = 20 o.BootstrapPeers = dht.DefaultBootstrapPeers o.IDGenerator = idgen.HydraIdentityGenerator return nil }
Defaults are the default Hydra options. This option will be automatically prepended to any options you pass to the Hydra constructor.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is the Hydra option type.
func Addr ¶
Addr configures the swarm address for this Hydra node. The default value is /ip4/0.0.0.0/tcp/0.
func BootstrapPeers ¶
BootstrapPeers configures the set of bootstrap peers that should be randomly selected from. The default value is `dht.DefaultBootstrapPeers`.
func BucketSize ¶
BucketSize configures the bucket size of the routing table. The default value is 20.
func Datastore ¶
Datastore configures the Hydra Node to use the specified datastore. Defaults to an in-memory (temporary) map.
func IDGenerator ¶
func IDGenerator(g idgen.IdentityGenerator) Option
IDGenerator configures the identity generator. The default value is `idgen.HydraIdentityGenerator`.
func Limiter ¶
func Limiter(l chan struct{}) Option
Limiter configures ???. The default value is nil.
func ProtocolPrefix ¶
ProtocolPrefix configures the application specific prefix attached to all DHT protocols by default. The default value is "/ipfs".
func RoutingTable ¶
func RoutingTable(rt *kbucket.RoutingTable) Option
RoutingTable configures the Hydra Node to use the specified routing table. Defaults to the routing table provided by IpfsDHT.