controllers

package
v0.0.0-...-59d5b1f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Server *echo.Echo
	DB     *gorm.DB
}

API is our api model

func (*API) CreateResource

func (api *API) CreateResource(c echo.Context) error

CreateResource creates a new resource in the db

func (*API) CreateUser

func (api *API) CreateUser(c echo.Context) error

CreateUser creates a new User in the db

func (*API) CreateVote

func (api *API) CreateVote(c echo.Context) error

CreateVote creates a new vote in the db

func (*API) GetCategories

func (api *API) GetCategories(c echo.Context) error

GetCategories gets all categories from the database

func (*API) GetResources

func (api *API) GetResources(c echo.Context) error

GetResources gets all resources

func (*API) GetResourcesByTopic

func (api *API) GetResourcesByTopic(c echo.Context) error

GetResourcesByTopic gets all resources by topic id

func (*API) GetTopics

func (api *API) GetTopics(c echo.Context) error

GetTopics gets all topics

func (*API) GetTopicsByCategory

func (api *API) GetTopicsByCategory(c echo.Context) error

GetTopicsByCategory gets all topics by category id

func (*API) LoginUser

func (api *API) LoginUser(c echo.Context) error

LoginUser authenticates an existing user in the db

func (*API) RegisterCategories

func (api *API) RegisterCategories()

RegisterCategories registers categories routes with api

func (*API) RegisterResources

func (api *API) RegisterResources()

RegisterResources registers resources routes with api

func (*API) RegisterRoutes

func (api *API) RegisterRoutes()

RegisterRoutes registers api routes with echo server

func (*API) RegisterTopics

func (api *API) RegisterTopics()

RegisterTopics registers topics routes with api

func (*API) RegisterUsers

func (api *API) RegisterUsers()

RegisterUsers registers Users routes with api

Jump to

Keyboard shortcuts

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