handler

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieDTO

type CookieDTO struct {
	ID       xid.ID  `json:"id"`
	Title    string  `json:"title"`
	Category *string `json:"category:omitempty"`
	Fortune  string  `json:"fortune"`
}

type CookieHandler

type CookieHandler struct {
	// contains filtered or unexported fields
}

func (*CookieHandler) Create

func (h *CookieHandler) Create(c echo.Context) error

func (*CookieHandler) Delete

func (h *CookieHandler) Delete(c echo.Context) error

func (*CookieHandler) List

func (h *CookieHandler) List(c echo.Context) error

func (*CookieHandler) Modify

func (h *CookieHandler) Modify(c echo.Context) error

type CreateRequestDTO

type CreateRequestDTO struct {
	Title    string  `json:"title"`
	Category *string `json:"category"`
}

type CreateResponseDTO

type CreateResponseDTO struct {
	Cookie CookieDTO `json:"cookie"`
}

type DeleteRequestDTO

type DeleteRequestDTO struct {
	ID xid.ID `json:"id"`
}

type DeleteResponseDTO

type DeleteResponseDTO struct {
}

type Handler

type Handler interface {
	Create(c echo.Context) error
	List(c echo.Context) error
	Delete(c echo.Context) error
	Modify(c echo.Context) error
}

func NewCookieHandler

func NewCookieHandler(methods cookie.Methods) Handler

type ListRequestDTO

type ListRequestDTO struct {
}

type ListResponseDTO

type ListResponseDTO struct {
	Cookies []CookieDTO `json:"cookies"`
}

type MockHandler

type MockHandler struct {
	mock.Mock
}

func NewMockHandler

func NewMockHandler() *MockHandler

func (*MockHandler) Create

func (h *MockHandler) Create(c echo.Context) error

func (*MockHandler) Delete

func (h *MockHandler) Delete(c echo.Context) error

func (*MockHandler) List

func (h *MockHandler) List(c echo.Context) error

func (*MockHandler) Modify

func (h *MockHandler) Modify(c echo.Context) error

type ModifyRequestDTO

type ModifyRequestDTO struct {
	ID       xid.ID  `json:"id"`
	Title    string  `json:"title"`
	Category *string `json:"category"`
}

type ModifyResponseDTO

type ModifyResponseDTO struct {
	Cookie CookieDTO `json:"cookie"`
}

Jump to

Keyboard shortcuts

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