rest

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package http is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var KhumuJWTConfig = middleware.JWTConfig{
	Skipper: func(c echo.Context) bool {
		return false
	},
	SigningKey:    []byte(os.Getenv("KHUMU_SECRET")),
	SigningMethod: "HS256",
	ContextKey:    "user",
	TokenLookup:   "header:" + echo.HeaderAuthorization,
	AuthScheme:    "Bearer",
	Claims:        jwt.MapClaims{},
}

Functions

func CustomHTTPErrorHandler

func CustomHTTPErrorHandler(err error, c echo.Context)

HTTPErrorHandler 참고 https://echo.labstack.com/guide/error-handling/

func KhumuRequestLog

func KhumuRequestLog(handlerFunc echo.HandlerFunc) echo.HandlerFunc

application/json 요청인 경우 바디를 출력.

func NewEcho

func NewEcho(commentUC usecase.CommentUseCaseInterface,
	likeUC usecase.LikeCommentUseCaseInterface,
	repo *ent.Client) *echo.Echo

Types

type Authenticator

type Authenticator struct {
	Repo *ent.Client
}

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(handlerFunc echo.HandlerFunc) echo.HandlerFunc

func (*Authenticator) KhumuBasicAuth

func (a *Authenticator) KhumuBasicAuth(username, password string, c echo.Context) (bool, error)

type CommentResponse

type CommentResponse struct {
	Data    *data.CommentOutput `json:"data"` //this contains any format of comments
	Message string              `json:"message"`
}

type CommentRouter

type CommentRouter struct {
	*echo.Group
	// contains filtered or unexported fields
}

func (*CommentRouter) Create

func (r *CommentRouter) Create(c echo.Context) error

func (*CommentRouter) Delete

func (r *CommentRouter) Delete(c echo.Context) error

func (*CommentRouter) Get

func (r *CommentRouter) Get(c echo.Context) error

func (*CommentRouter) GetCommentCount

func (r *CommentRouter) GetCommentCount(c echo.Context) error

해당 Article에 대해 필요한 댓글 정보들

func (*CommentRouter) LikeToggle

func (r *CommentRouter) LikeToggle(c echo.Context) error

func (*CommentRouter) List

func (r *CommentRouter) List(c echo.Context) error

func (*CommentRouter) Update

func (r *CommentRouter) Update(c echo.Context) error

type CommentsResponse

type CommentsResponse struct {
	Data    []*data.CommentOutput `json:"data"` //this contains any format of comments
	Message string                `json:"message"`
}

type CustomBinder

type CustomBinder struct{}

func (*CustomBinder) Bind

func (cb *CustomBinder) Bind(i interface{}, c echo.Context) (err error)

type GetInfoAboutArticleReq

type GetInfoAboutArticleReq struct {
	Article int `json:"article"`
}

type GetInfoAboutArticleResp

type GetInfoAboutArticleResp struct {
	CommentCount int `json:"comment_count"`
}

type LikeCommentResponse

type LikeCommentResponse struct {
	Data    bool   `json:"data"` //this contains any format of comments
	Message string `json:"message"`
}

type RootRouter

type RootRouter struct{ *echo.Group }

의존성 주입시에 root router를 판별하기 위해 임베딩

func NewRootRouter

func NewRootRouter(echoServer *echo.Echo, repo *ent.Client) *RootRouter

Jump to

Keyboard shortcuts

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