// RenderPath renders a path on top of a Goreland world.
968006
func (w Goreland) RenderPath(path []Pather) string {

	s := ""
	for _, p := range path {
		pT := p.(*Truck)
		s = pT.label + " " + s
	}
	return s
}
369047
func (ex *backendExplorer) HandlePath(nodePath string, r *http.Request) *Result {
	ctx := context.Background()
	result := &Result{}

	// Handle toplevel display: global, then one line per cell.
	if nodePath == "/" {
		cells, err := ex.ts.GetKnownCells(ctx)
		if err != nil {
			result.Error = err.Error()
			return result
		}
		sort.Strings(cells)
		result.Children = append([]string{topo.GlobalCell}, cells...)
		return result
	}

	// Now find the cell.
	parts := strings.Split(nodePath, "/")
	if parts[0] != "" || len(parts) < 2 {
		result.Error = "Invalid path: " + nodePath
		return result
	}
	cell := parts[1]
	relativePath := nodePath[len(cell)+1:]
	conn, err := ex.ts.ConnForCell(ctx, cell)
	if err != nil {
		result.Error = fmt.Sprintf("Invalid cell: %v", err)
		return result
	}

	// Get the file contents, if any.
	data, _, err := conn.Get(ctx, relativePath)
	switch err {
	case nil:
		if len(data) > 0 {
			// It has contents, we just use it if possible.
			decoded, err := vtctl.DecodeContent(relativePath, data, false)
			if err != nil {
				result.Error = err.Error()
			} else {
				result.Data = decoded
			}

			// With contents, it can't have children, so we're done.
			return result
		}
	default:
		// Something is wrong. Might not be a file.
		result.Error = err.Error()
	}

	// Get the children, if any.
	children, err := conn.ListDir(ctx, relativePath, false /*full*/)
	if err != nil {
		// It failed as a directory, let's just return what it did
		// as a file.
		return result
	}

	// It worked as a directory, clear any file error.
	result.Error = ""
	result.Children = topo.DirEntriesToStringArray(children)
	return result
}
742916
func (c *context) fullpath(p string) (string, error) {
	p = c.pathDriver.Join(c.root, p)
	if !strings.HasPrefix(p, c.root) {
		return "", fmt.Errorf("invalid context path")
	}

	return p, nil
}
1257351
func Render(w http.ResponseWriter, r *http.Request, v Renderer) error {
	if err := renderer(w, r, v); err != nil {
		return err
	}
	Respond(w, r, v)
	return nil
}
773589
func (f *FileResourceLookup) ResolvePath(path, inFile string) string {
	vs := strings.SplitN(path, ":", 2)
	if len(vs) == 2 && !filepath.IsAbs(vs[0]) {
		log.Warnf("Rancher Compose will not resolve relative path %s", vs[0])
	}
	return path
}
466380
func (ctx *ServiceContext) ResolvePath(path string) string {
	return ctx.config.ResolvePath(path)
}
55462
func (v *view) fragmentPath(shard uint64) string {
	return filepath.Join(v.path, "fragments", strconv.FormatUint(shard, 10))
}
658711
func GenericPath(mg MinimalGraphics, x, y []int, style Style) {
	n := imin(len(x), len(y))
	for i := 1; i < n; i++ {
		mg.Line(x[i-1], y[i-1], x[i], y[i], style)
	}
}
480072
func (item *OrderItem) ProductPath() string {
	item.loadSizeVariation()
	return item.SizeVariation.ColorVariation.ViewPath()
}
1279871
func HTTPPath(u string) option {
	return func(c *sass) error {
		c.httpPath = u
		c.ctx.HTTPPath = u
		return nil
	}
}
300428
func (colorVariation ColorVariation) ViewPath() string {
	defaultPath := ""
	var product Product
	if !db.DB.First(&product, "id = ?", colorVariation.ProductID).RecordNotFound() {
		defaultPath = fmt.Sprintf("/products/%s_%s", product.Code, colorVariation.ColorCode)
	}
	return defaultPath
}
818028
func (node *Expression) FieldPath() *PathExpression {
	path, ok := node.Path.(*PathExpression)
	if !ok {
		return nil
	}

	return path
}
180017
func renderRegion(data result.AggData, y int) int {
	x := 0
	renderString(x, y, "Region: ", termbox.ColorWhite, termbox.ColorBlue)
	x += 8
	regionStr := fmt.Sprintf("%s", data.Region)
	renderString(x, y, regionStr, termbox.ColorWhite|termbox.AttrBold, termbox.ColorBlue)
	x = 0
	y++
	headingStr := "   TotReqs   TotBytes    AvgTime    AvgReq/s  (post)unzip"
	renderString(x, y, headingStr, coldef|termbox.AttrBold, coldef)
	y++
	resultStr := fmt.Sprintf("%10d %10s   %7.3fs  %10.2f %10s/s", data.TotalReqs, humanize.Bytes(uint64(data.TotBytesRead)), float64(data.AveTimeForReq)/nano, data.AveReqPerSec, humanize.Bytes(uint64(data.AveKBytesPerSec)))
	renderString(x, y, resultStr, coldef, coldef)
	y++
	headingStr = "   Slowest    Fastest   Timeouts  TotErrors"
	renderString(x, y, headingStr, coldef|termbox.AttrBold, coldef)
	y++
	resultStr = fmt.Sprintf("  %7.3fs   %7.3fs %10d %10d", float64(data.Slowest)/nano, float64(data.Fastest)/nano, data.TotalTimedOut, totErrors(data))
	renderString(x, y, resultStr, coldef, coldef)
	y++

	return y
}
106931
func (b *RouteBuilder) Path(subPath string) *RouteBuilder {
	b.currentPath = subPath
	return b
}
146172
func (c *Controller) RenderFile(file *os.File, delivery ContentDisposition) Result {
	c.setStatusIfNil(http.StatusOK)

	var (
		modtime       = time.Now()
		fileInfo, err = file.Stat()
	)
	if err != nil {
		controllerLog.Error("RenderFile: error", "error", err)
	}
	if fileInfo != nil {
		modtime = fileInfo.ModTime()
	}
	return c.RenderBinary(file, filepath.Base(file.Name()), delivery, modtime)
}
1032079
func (t *vhostTrie) insertPath(remainingPath, originalPath string, site *SiteConfig) {
	if remainingPath == "" {
		t.site = site
		t.path = originalPath
		return
	}
	ch := string(remainingPath[0])
	if _, ok := t.edges[ch]; !ok {
		t.edges[ch] = newVHostTrie()
	}
	t.edges[ch].insertPath(remainingPath[1:], originalPath, site)
}
427703
func (c *Client) renderOptions(opts []grpc.CallOption) (*Options, error) {
	var options *Options
	if c.Options != nil {
		cpy := *c.Options
		options = &cpy
	} else {
		options = DefaultOptions()
	}
	if err := options.apply(opts); err != nil {
		return nil, err
	}
	return options, nil
}