Documentation ¶
Index ¶
Constants ¶
const ( // DefaultDepthLimit is the default depth limit used by Resolve. DefaultDepthLimit = 32 // UnlimitedDepth allows infinite recursion in Resolve. You // probably don't want to use this, but it's here if you absolutely // trust resolution to eventually complete and can't put an upper // limit on how many steps it will take. UnlimitedDepth = 0 // DefaultIPNSRecordTTL specifies the time that the record can be cached // before checking if its validity again. DefaultIPNSRecordTTL = time.Minute // DefaultIPNSRecordEOL specifies the time that the network will cache IPNS // records after being published. Records should be re-published before this // interval expires. We use the same default expiration as the DHT. DefaultIPNSRecordEOL = 48 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PublishOption ¶
type PublishOption func(*PublishOptions)
PublishOption is used to set an option for PublishOpts.
func PublishWithTTL ¶
func PublishWithTTL(ttl time.Duration) PublishOption
PublishWithEOL sets a TTL.
type PublishOptions ¶
PublishOptions specifies options for publishing an IPNS record.
func DefaultPublishOptions ¶
func DefaultPublishOptions() PublishOptions
DefaultPublishOptions returns the default options for publishing an IPNS record.
func ProcessPublishOptions ¶
func ProcessPublishOptions(opts []PublishOption) PublishOptions
ProcessPublishOptions converts an array of PublishOpt into a PublishOpts object.
type ResolveOpt ¶
type ResolveOpt func(*ResolveOpts)
ResolveOpt is used to set an option
func DhtRecordCount ¶
func DhtRecordCount(count uint) ResolveOpt
DhtRecordCount is the number of IPNS records to retrieve from the DHT
func DhtTimeout ¶
func DhtTimeout(timeout time.Duration) ResolveOpt
DhtTimeout is the amount of time to wait for DHT records to be fetched and verified. A zero value indicates that there is no explicit timeout
type ResolveOpts ¶
type ResolveOpts struct { // Recursion depth limit Depth uint // The number of IPNS records to retrieve from the DHT // (the best record is selected from this set) DhtRecordCount uint // The amount of time to wait for DHT records to be fetched // and verified. A zero value indicates that there is no explicit // timeout (although there is an implicit timeout due to dial // timeouts within the DHT) DhtTimeout time.Duration }
ResolveOpts specifies options for resolving an IPNS path
func DefaultResolveOpts ¶
func DefaultResolveOpts() ResolveOpts
DefaultResolveOpts returns the default options for resolving an IPNS path
func ProcessOpts ¶
func ProcessOpts(opts []ResolveOpt) ResolveOpts
ProcessOpts converts an array of ResolveOpt into a ResolveOpts object