post

package
v0.0.0-...-c52fe67 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	PostService service.PostService
}

func NewHandler

func NewHandler(params Params) Handler

func (Handler) Delete

func (h Handler) Delete(c echo.Context) error

swagger:route DELETE /posts/{id} posts reqPostDelete

Delete the post

This endpoint will delete the post and return

Responses:
  200: Post
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) Draft

func (h Handler) Draft(c echo.Context) error

swagger:route POST /posts/{id}/draft posts reqPostDraft

Change post status to draft

This endpoint will change the status of the post to draft and return the extended post structure

Responses:
  200: Post
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) GetByFilter

func (h Handler) GetByFilter(c echo.Context) error

swagger:route GET /posts posts reqGetPostByFilter

Getting a list of posts by filter

This endpoint returns a list of extended post structures

Responses:
  200: PostList
  500: HTTPError

func (Handler) GetByID

func (h Handler) GetByID(c echo.Context) error

swagger:route GET /posts/{id} posts reqGetPostByID

Getting a post by ID

This endpoint returns the structure of the post

Responses:
  200: Post
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) Publish

func (h Handler) Publish(c echo.Context) error

swagger:route POST /posts/{id}/publish posts reqPostPublish

Publishing the post

This endpoint will publish the post and return the extended post structure

Responses:
  200: Post
  400: HTTPError
  404: HTTPError
  500: HTTPError

func (Handler) Upsert

func (h Handler) Upsert(c echo.Context) error

swagger:route POST /posts posts reqPostUpsert

Create or update post information

This endpoint will create or update the post and returns the post structure

Responses:
  200: Post
  400: HTTPError
  404: HTTPError
  500: HTTPError

type Params

type Params struct {
	fx.In

	PostService service.PostService
}

type ReqContent

type ReqContent struct {
	LanguageID uint   `json:"language_id"`
	Title      string `json:"title"`
	Summary    string `json:"summary"`
	Body       string `json:"body"`
}

Jump to

Keyboard shortcuts

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