rest

package
v0.0.0-...-5c9176d Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostHandler

func NewPostHandler(app *fiber.App, p domain.PostUsecase)

NewPostHandler will initialize the post resource endpoint

Types

type PostHandler

type PostHandler struct {
	PUsecase domain.PostUsecase
}

PostHandler represent the rest handler for post

func (*PostHandler) Delete

func (ph *PostHandler) Delete(c *fiber.Ctx) error

Delete will delete post by given param

func (*PostHandler) FetchPost

func (ph *PostHandler) FetchPost(c *fiber.Ctx) error

FetchPost will fetch the Post based on given params

func (*PostHandler) GetByID

func (ph *PostHandler) GetByID(c *fiber.Ctx) error

GetByID will get post by given id

func (*PostHandler) Store

func (ph *PostHandler) Store(c *fiber.Ctx) (err error)

Store will store the new Post base on given data

type ResponseError

type ResponseError struct {
	Error   int    `json:"error"`
	Message string `json:"message"`
}

ResponseError represent the response error struct

Jump to

Keyboard shortcuts

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