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: 0

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