func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
	options, err := caopts.NameResolveOptions(opts...)
	if err != nil {
		return nil, err
	}

	n := api.node

	if !n.OnlineMode() {
		err := n.SetupOfflineRouting()
		if err != nil {
			return nil, err
		}
	}

	var resolver namesys.Resolver = n.Namesys

	if options.Local && !options.Cache {
		return nil, errors.New("cannot specify both local and nocache")
	}

	if options.Local {
		offroute := offline.NewOfflineRouter(n.Repo.Datastore(), n.RecordValidator)
		resolver = namesys.NewDms3NsResolver(offroute)
	}

	if !options.Cache {
		resolver = namesys.NewNameSystem(n.Routing, n.Repo.Datastore(), 0)
	}

	if !strings.HasPrefix(name, "/dms3ns/") {
		name = "/dms3ns/" + name
	}

	var ropts []nsopts.ResolveOpt
	if !options.Recursive {
		ropts = append(ropts, nsopts.Depth(1))
	}

	output, err := resolver.Resolve(ctx, name, ropts...)
	if err != nil {
		return nil, err
	}

	return coreiface.ParsePath(output.String())
}
// Resolve attempts to resolve the newest version of the specified name and
// returns its path.
Resolve attempts to resolve the newest version of the specified name and
returns its path.
// Resolve attempts to resolve the newest version of the specified name and // returns its path .
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
	options, err := caopts.NameResolveOptions(opts...)
	if err != nil {
		return nil, err
	}
	n := api.node
	if !n.OnlineMode() {
		err := n.SetupOfflineRouting()
		if err != nil {
			return nil, err
		}
	}
	var resolver namesys.Resolver = n.Namesys
	if options.Local && !options.Cache {
		return nil, errors.New("cannot specify both local and nocache")
	}
	if options.Local {
		offroute := offline.NewOfflineRouter(n.Repo.Datastore(), n.RecordValidator)
		resolver = namesys.NewDms3NsResolver(offroute)
	}
	if !options.Cache {
		resolver = namesys.NewNameSystem(n.Routing, n.Repo.Datastore(), 0)
	}
	if !strings.HasPrefix(name, "/dms3ns/") {
		name = "/dms3ns/" + name
	}
	var ropts []nsopts.ResolveOpt
	if !options.Recursive {
		ropts = append(ropts, nsopts.Depth(1))
	}
	output, err := resolver.Resolve(ctx, name, ropts...)
	if err != nil {
		return nil, err
	}
	return coreiface.ParsePath(output.String())
}
func ( api * NameAPI ) Resolve ( ctx context . Context , name string , opts ... caopts . NameResolveOption ) ( coreiface . Path , error ) { options , err := caopts . NameResolveOptions ( opts ... ) if err != nil { return nil , err } n := api . node if ! n . OnlineMode ( ) { err := n . SetupOfflineRouting ( ) if err != nil { return nil , err } } var resolver namesys . Resolver = n . Namesys if options . Local && ! options . Cache { return nil , errors . New ( " " ) } if options . Local { offroute := offline . NewOfflineRouter ( n . Repo . Datastore ( ) , n . RecordValidator ) resolver = namesys . NewDms3NsResolver ( offroute ) } if ! options . Cache { resolver = namesys . NewNameSystem ( n . Routing , n . Repo . Datastore ( ) , 0 ) } if ! strings . HasPrefix ( name , " " ) { name = " " + name } var ropts [ ] nsopts . ResolveOpt if ! options . Recursive { ropts = append ( ropts , nsopts . Depth ( 1 ) ) } output , err := resolver . Resolve ( ctx , name , ropts ... ) if err != nil { return nil , err } return coreiface . ParsePath ( output . String ( ) ) }
Resolve attempts to resolve the newest version of the specified name and
returns its path.
Resolve attempts to resolve the newest version of the specified name and returns its path .