namespace

package
v0.11.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootNamespaceID = "root"
)

Variables

View Source
var (
	ErrNoNamespace error = errors.New("no namespace")
)

Functions

func Canonicalize

func Canonicalize(nsPath string) string

Canonicalize trims any prefix '/' and adds a trailing '/' to the provided string

func ContextWithNamespace

func ContextWithNamespace(ctx context.Context, ns *Namespace) context.Context

func TestContext

func TestContext() context.Context

Types

type Namespace

type Namespace struct {
	ID   string `json:"id"`
	Path string `json:"path"`
}

func FromContext

func FromContext(ctx context.Context) (*Namespace, error)

func New

func New(id, path string) *Namespace

func (*Namespace) HasParent

func (n *Namespace) HasParent(possibleParent *Namespace) bool

func (*Namespace) TrimmedPath

func (n *Namespace) TrimmedPath(path string) string

Jump to

Keyboard shortcuts

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