handler

package
v0.0.0-...-b80ed3d Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RBAC *gorbac.RBAC
)

RBAC is an instance of the Role-Based Access Control

Functions

func AppController

func AppController(c echo.Context) error

AppController handles the "/" route.

func AssignUser

func AssignUser(c echo.Context) error

AssignUser handles the "/users/:id/assign" route.

func AuthUser

func AuthUser(c echo.Context) error

AuthUser handles the "users/auth" route.

func CreateArticle

func CreateArticle(c echo.Context) error

CreateArticle handles the "/posts/articles/create" route.

func CreateFlicker

func CreateFlicker(c echo.Context) error

CreateFlicker handles the "/posts/flickers/create" route.

func CreateGallery

func CreateGallery(c echo.Context) error

CreateGallery handles the "/posts/galleries/create" route.

func CreateReaction

func CreateReaction(c echo.Context) error

CreateReaction handles the "/reactions/create" route.

func DeletePost

func DeletePost(c echo.Context) error

DeletePost handles the "/posts/:id/delete" route.

func DeleteReaction

func DeleteReaction(c echo.Context) error

DeleteReaction handles the "/reactions/:id/delete" route.

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser handles the "/users/:id/delete" route.

func GetArticleByID

func GetArticleByID(c echo.Context) error

GetArticleByID handles the "/posts/articles/:id" route.

func GetArticles

func GetArticles(c echo.Context) error

GetArticles handles the "/posts/articles" route.

func GetFlickerByID

func GetFlickerByID(c echo.Context) error

GetFlickerByID handles the "/posts/flickers/:id" route.

func GetFlickers

func GetFlickers(c echo.Context) error

GetFlickers handles the "/posts/flickers" route.

func GetGalleries

func GetGalleries(c echo.Context) error

GetGalleries handles the "/posts/galleries" route.

func GetGalleryByID

func GetGalleryByID(c echo.Context) error

GetGalleryByID handles the "/posts/galleries/:id" route.

func GetPostReactionByID

func GetPostReactionByID(c echo.Context) error

GetPostReactionByID handles the "/reactions/:id" route.

func GetPostReactions

func GetPostReactions(c echo.Context) error

GetPostReactions handles the "/posts/:id/reactions" route.

func GetPublicArticleByID

func GetPublicArticleByID(c echo.Context) error

GetPublicArticleByID handles the "/posts/articles/public/:id" route.

func GetPublicArticles

func GetPublicArticles(c echo.Context) error

GetPublicArticles handles the "/posts/articles/public" route.

func GetPublicFlickerByID

func GetPublicFlickerByID(c echo.Context) error

GetPublicFlickerByID handles the "/posts/flickers/public/:id" route.

func GetPublicFlickers

func GetPublicFlickers(c echo.Context) error

GetPublicFlickers handles the "/posts/flickers/public" route.

func GetPublicGalleries

func GetPublicGalleries(c echo.Context) error

GetPublicGalleries handles the "/posts/galleries/public" route.

func GetPublicGalleryByID

func GetPublicGalleryByID(c echo.Context) error

GetPublicGalleryByID handles the "/posts/galleries/public/:id" route.

func GetUserByID

func GetUserByID(c echo.Context) error

GetUserByID handles the "/users/:id" route.

func GetUserPublicArticles

func GetUserPublicArticles(c echo.Context) error

GetUserPublicArticles handles the "/users/:id/posts/articles" route.

func GetUserPublicFlickers

func GetUserPublicFlickers(c echo.Context) error

GetUserPublicFlickers handles the "/users/:id/posts/flickers" route.

func GetUserPublicGalleries

func GetUserPublicGalleries(c echo.Context) error

GetUserPublicGalleries handles the "/users/:id/posts/galleries" route.

func GetUserReactions

func GetUserReactions(c echo.Context) error

GetUserReactions handles the "/users/:id/reactions" route.

func GetUsers

func GetUsers(c echo.Context) error

GetUsers handles the "/users" route.

func InitRBAC

func InitRBAC() error

InitRBAC initializes the Role-Based Access Control HACK Ignored error handling

func JoinUser

func JoinUser(c echo.Context) error

JoinUser handles the "/users/join" route.

func PublishPost

func PublishPost(c echo.Context) error

PublishPost handles the "/posts/:id/publish" route.

func RetractPost

func RetractPost(c echo.Context) error

RetractPost handles the "/posts/:id/retract" route.

func TransferArticle

func TransferArticle(c echo.Context) error

TransferArticle handles the "/posts/articles/:id/transfer" route.

func TransferFlicker

func TransferFlicker(c echo.Context) error

TransferFlicker handles the "/posts/flickers/:id/transfer" route.

func TransferGallery

func TransferGallery(c echo.Context) error

TransferGallery handles the "/posts/galleries/:id/transfer" route.

func UpdateArticle

func UpdateArticle(c echo.Context) error

UpdateArticle handles the "/posts/articles/:id/update" route.

func UpdateFlicker

func UpdateFlicker(c echo.Context) error

UpdateFlicker handles the "/posts/flickers/:id/update" route.

func UpdateGallery

func UpdateGallery(c echo.Context) error

UpdateGallery handles the "/posts/galleries/:id/update" route.

func UpdatePass

func UpdatePass(c echo.Context) error

UpdatePass handles the "/users/me/change" route.

func UpdateReaction

func UpdateReaction(c echo.Context) error

UpdateReaction handles the "/reactions/:id/update" route.

func UpdateUser

func UpdateUser(c echo.Context) error

UpdateUser handles the "/users/me/update" route.

Types

type ArticlesResponse

type ArticlesResponse struct {
	Response
	Articles []model.Article `json:"data"`
}

ArticlesResponse is a response containing a slice of Articles

type FlickersResponse

type FlickersResponse struct {
	Response
	Flickers []model.Flicker `json:"data"`
}

FlickersResponse is a response containing a slice of Flickers

type GalleriesResponse

type GalleriesResponse struct {
	Response
	Galleries []model.Gallery `json:"data"`
}

GalleriesResponse is a response containing a slice of Galleries

type JwtCustomClaims

type JwtCustomClaims struct {
	User uuid.UUID      `json:"user"`
	Role model.UserRole `json:"role"`
	jwt.StandardClaims
}

JwtCustomClaims are custom claims extending default ones.

type PostResponse

type PostResponse struct {
	Response
	model.Post `json:"data"`
}

PostResponse is a response containing one Post

type ReactionResponse

type ReactionResponse struct {
	Response
	model.Reaction `json:"data"`
}

ReactionResponse is a response containing one Reaction

type ReactionsResponse

type ReactionsResponse struct {
	Response
	Reactions []model.Reaction `json:"data"`
}

ReactionsResponse is a response containing a slice of Reactions

type Response

type Response struct {
	Status  bool   `json:"status"`
	Message string `json:"message"`
}

Response is the base response type

type UserResponse

type UserResponse struct {
	Response
	model.User `json:"data"`
}

UserResponse is a response containing one User

type UsersResponse

type UsersResponse struct {
	Response
	Users []model.User `json:"data"`
}

UsersResponse is a response containing a slice of Users

Jump to

Keyboard shortcuts

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