categories

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Categories

type Categories struct {
	Categories []*Category `json:"categories"`
}

type Category

type Category struct {
	Name     string `json:"name"`
	Id       int    `json:"id"`
	TopLevel bool   `json:"top_level"`
	Featured bool   `json:"featured"`
}

func FromDBType

func FromDBType(dbCategory *db.Category) *Category

func FromDBTypeArray

func FromDBTypeArray(dbCategories []*db.Category) []*Category

type CategoryCountDTO

type CategoryCountDTO struct {
	Name      string `json:"name"`
	Services  int    `json:services`
	Resources int    `json:resources`
}

type Manager

type Manager struct {
	DbClient *db.Manager
}

func New

func New(dbManager *db.Manager) *Manager

func (*Manager) Get

func (m *Manager) Get(w http.ResponseWriter, r *http.Request)

Get lists all existing categories

@Summary		Get Categories
@Description	get all categories
@Tags			categories
@Accept			json
@Produce		json
@Success		200	{array}	categories.Categories
@Router			/categories [get]

func (*Manager) GetByFeatured

func (m *Manager) GetByFeatured(w http.ResponseWriter, _ *http.Request)

func (*Manager) GetByID

func (m *Manager) GetByID(w http.ResponseWriter, r *http.Request)

func (*Manager) GetCategoryCounts

func (m *Manager) GetCategoryCounts(w http.ResponseWriter, _ *http.Request)

func (*Manager) GetSubCategoriesByID

func (m *Manager) GetSubCategoriesByID(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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