categories

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2017 License: MIT Imports: 2 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Index map[string]int

Functions

func Exists

func Exists(category string) bool

Exists : Check if a category exist in config

func InitCategories

func InitCategories()

InitCategories init the categories and index variables. Exported for tests

Types

type Categories

type Categories []Category

Cateogories is a struct defining an array of categories

func All

func All() Categories

All : function to get all categories depending on the actual website from config/categories.go

func GetSelect

func GetSelect(keepParent bool, keepChild bool) Categories

GetSelect : Format categories in map ordered alphabetically

func (Categories) Exists

func (cats Categories) Exists(id string) bool

Exists : Check if a category exist in config

type Category

type Category struct {
	ID   string
	Name string
}

Category is a struct defining a category

func Get

func Get(key int) Category

Get : function to get a category by the key in the index array

func GetByID

func GetByID(id string) (Category, bool)

GetByID : function to get a category by the id of the category from the database

Jump to

Keyboard shortcuts

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