paths

package
v0.0.0-...-99ae320 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChild

func AddChild(pathid string, elementid string, w *wrapper.Wrapper) error

Add a child element to an existing Path

func Delete

func Delete(id string, w *wrapper.Wrapper) error

Delete a path by id.

func DeleteAllChild

func DeleteAllChild(id string, w *wrapper.Wrapper) error

Delete all references to a child element in all paths by id.

Types

type Path

type Path struct {
	MongoId      bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Path         string        `bson:"path" json:"path"`
	Wildcard     bool          `bson:"wildcard" json:"wildcard"`
	Template     string        `bson:"template" json:"template"`
	Status       string        `bson:"status" json:"status"`
	Title        string        `bson:"title" json:"title"`
	PathElements `bson:",inline,omitempty"`
}

Path Structure

func LoadPath

func LoadPath(i string, w *wrapper.Wrapper) (Path, error)

Construct and Get Path by ID

func NewPath

func NewPath() Path

Constructor for paths

func PathList

func PathList(w *wrapper.Wrapper) ([]Path, error)

Get all Paths

func (*Path) GetById

func (p *Path) GetById(i string, w *wrapper.Wrapper) error

Get Path by Id on constructed Path

func (*Path) PathMatch

func (p *Path) PathMatch(u string, s string, w *wrapper.Wrapper) (string, error)

Given a URL and status this query will attempt to find a matching path. First the query qill attempt to implicitly match the url without a wildcard Then it will attempt to match based on the same path value having a wildcard After that it will remove sections of the url each time looking for a wildcard match If it does not find any matches it retrns the last error.

func (*Path) Save

func (p *Path) Save(w *wrapper.Wrapper) error

Save a path in its current state.

type PathElements

type PathElements struct {
	Elements []string `bson:"elements,omitempty" json:"elements,omitempty"`
}

PathElements Structure to define the Elements in a path for easy json and bson marshalling.

func NewPathElements

func NewPathElements() PathElements

Constructor for path elements.

Jump to

Keyboard shortcuts

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