route

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package route provides route-related convenience functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPath

func FromPath(contentDir, path string) string

FromPath converts a filepath to a valid verless route that can be registered in a route tree.

A filepath like `content/blog/making-barista-quality-espresso.md` will be converted to `/blog/making-barista-quality-espresso`, for example.

func IsRoot

func IsRoot(route string) bool

IsRoot indicates if a given route is the root route.

func IsValid

func IsValid(route string) bool

IsValid indicates whether a given route is valid or not.

func ToSegments

func ToSegments(route string) []string

ToSegments returns the individual segments for a route. Those segments represent the nodes for a route tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL