Source File
options.go
Belonging Package
github.com/libp2p/go-libp2p/core/routing
package routing// Option is a single routing option.type Option func(opts *Options) error// Options is a set of routing optionstype Options struct {// Allow expired values.Expired boolOffline bool// Other (ValueStore implementation specific) options.Other map[interface{}]interface{}}// Apply applies the given options to this Optionsfunc ( *Options) ( ...Option) error {for , := range {if := (); != nil {return}}return nil}// ToOption converts this Options to a single Option.func ( *Options) () Option {return func( *Options) error {* = *if .Other != nil {.Other = make(map[interface{}]interface{}, len(.Other))for , := range .Other {.Other[] =}}return nil}}// Expired is an option that tells the routing system to return expired records// when no newer records are known.var Expired Option = func( *Options) error {.Expired = truereturn nil}// Offline is an option that tells the routing system to operate offline (i.e., rely on cached/local data only).var Offline Option = func( *Options) error {.Offline = truereturn nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |