tags

package
v0.0.0-...-e94906c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectRoutes

func InjectRoutes(r *mux.Router)

InjectRoutes adds Tag domain routes to the main router

Types

type Tag

type Tag struct {
	ID    bson.ObjectId `json:"id,omitempty" bson:"_id"`
	Title string        `json:"title" bson:"title"`
	Body  string        `json:"body" bson:"body"`
}

Tag represents a tag model, which acts as a label for all other Ignoshi features. All Features in Ignoshi are built around tags

func Find

func Find() ([]Tag, error)

Find returns a list of all tags exists in the db

func New

func New() Tag

New creates a new Tag object

func (*Tag) IsValid

func (t *Tag) IsValid() (ok bool, errs []error)

IsValid checks if all tag fields are valid before save

func (*Tag) Save

func (t *Tag) Save() error

Save saves tag into database, either update it or create new one

Jump to

Keyboard shortcuts

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