ui

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostsRouter

func NewPostsRouter(e *echo.Echo, postUsecase domain.PostUsecase) *postRouterCtx

Types

type GetPostParams

type GetPostParams struct {
	ID string `param:"id" validate:"required"`
}

type HTTPError

type HTTPError struct {
	Message string `json:"message"`
}

func (HTTPError) BadRequest

func (e HTTPError) BadRequest() error

func (HTTPError) Conflict

func (e HTTPError) Conflict() error

func (HTTPError) ErrUnprocessableEntity

func (e HTTPError) ErrUnprocessableEntity() error

func (HTTPError) Forbidden

func (e HTTPError) Forbidden() error

func (HTTPError) InternalServerError

func (e HTTPError) InternalServerError() error

func (HTTPError) NotFound

func (e HTTPError) NotFound() error

func (HTTPError) Unauthorized

func (e HTTPError) Unauthorized() error

type PostIn

type PostIn struct {
	Title       string `json:"title" validate:"required,min=5,max=128"`
	Author      string `json:"author" validate:"required,min=3,max=64"`
	Slug        string `json:"slug" validate:"required"`
	Description string `json:"description" validate:"required,min=5,max=255"`
	Content     string `json:"content" validate:"required,min=10"`
}

type PostOut

type PostOut struct {
	PublishedAt time.Time `json:"published_at"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	ID          string        `json:"id"`
	Title       string        `json:"title"`
	Author      string        `json:"author"`
	Slug        string        `json:"slug"`
	Status      domain.Status `json:"status"`
	Description string        `json:"description"`
	Content     string        `json:"content"`
}

type PostUpdate

type PostUpdate struct {
	Status      *domain.Status `json:"status" validate:"omitempty,oneof=draft published archived"`
	Title       *string        `json:"title" validate:"omitempty,required,min=5,max=128"`
	Author      *string        `json:"author" validate:"omitempty,required,min=3,max=64"`
	Slug        *string        `json:"slug" validate:"omitempty,required"`
	Description *string        `json:"description" validate:"omitempty,required,min=5,max=255"`
	Content     *string        `json:"content" validate:"omitempty,required,min=10"`
	ID          string         `param:"id" validate:"required"`
}

type PostsOut

type PostsOut struct {
	Data []*PostOut `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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