handlers

package
v0.0.0-...-f7315f1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeRoutes

func InitializeRoutes(server *echo.Echo, postStorage PostStorage)

InitializeRoutes ...

Types

type Post

type Post struct {
	Storage PostStorage
}

Post ...

func (Post) Create

func (handler Post) Create(ctx echo.Context) error

Create ...

func (Post) GetAll

func (handler Post) GetAll(ctx echo.Context) error

GetAll ...

func (Post) GetSingle

func (handler Post) GetSingle(ctx echo.Context) error

GetSingle ...

type PostStorage

type PostStorage interface {
	GetAll(pagination models.Pagination) ([]models.Post, error)
	GetSingle(id int) (models.Post, error)
	Create(post models.Post) (id int, err error)
}

PostStorage ...

Jump to

Keyboard shortcuts

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