controller

package
v0.0.0-...-43633ff Latest Latest
Warning

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

Go to latest
Published: May 16, 2017 License: MIT Imports: 5 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 BaseResponse

type BaseResponse struct {
	Success bool `json:"success"`
}

BaseResponse is the base HTTP response

type HTTPError

type HTTPError struct {
	BaseResponse
	Error []string `json:"errors,omitempty"`
}

HTTPError extends the base HTTP response for returning failed requests

func NewHTTPError

func NewHTTPError(errors []string) *HTTPError

NewHTTPError returns a failed request

type HTTPSuccess

type HTTPSuccess struct {
	BaseResponse
	Data interface{} `json:"data,omitempty"`
}

HTTPSuccess extends the base HTTP response for returning successful requests

func NewHTTPSuccess

func NewHTTPSuccess(v interface{}) *HTTPSuccess

NewHTTPSuccess returns a successful request

type Handler

type Handler struct {
	DB *pg.DB
}

Handler is the handler for route controller actions

func (*Handler) CreateCommunity

func (h *Handler) CreateCommunity(c echo.Context) error

CreateCommunity returns a single community

func (*Handler) CreateUser

func (h *Handler) CreateUser(c echo.Context) error

CreateUser creates a user

func (*Handler) DeleteCommunity

func (h *Handler) DeleteCommunity(c echo.Context) error

DeleteCommunity returns a single community

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(c echo.Context) error

DeleteUser soft deletes a user

func (*Handler) GetCommunities

func (h *Handler) GetCommunities(c echo.Context) error

GetCommunities list all communities

func (*Handler) GetCommunity

func (h *Handler) GetCommunity(c echo.Context) error

GetCommunity returns a single community

func (*Handler) GetUser

func (h *Handler) GetUser(c echo.Context) error

GetUser returns a single user

func (*Handler) GetUsers

func (h *Handler) GetUsers(c echo.Context) error

GetUsers list all communities

func (*Handler) Login

func (h *Handler) Login(c echo.Context) error

Login is the login endpoint handler

func (*Handler) Logout

func (h *Handler) Logout(c echo.Context) error

Logout is the logout endpoint handler

func (*Handler) Register

func (h *Handler) Register(c echo.Context) error

Register is the logout endpoint handler

func (*Handler) UpdateCommunity

func (h *Handler) UpdateCommunity(c echo.Context) error

UpdateCommunity returns a single community

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(c echo.Context) error

UpdateUser updates a user

Jump to

Keyboard shortcuts

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