wish

package
v0.0.0-...-0c3f4cd Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEmail       = errors.New("invalid email format")
	ErrEmailAlreadyExists = errors.New("email already exists")
)

Functions

func NewHandler

func NewHandler(s Service, g *gin.Engine, l *zap.Logger)

Types

type CreateWishRequest

type CreateWishRequest struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Wish      string    `json:"wish"`
	CreatedAt time.Time `json:"created_at"`
}

type CreateWishResponse

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

type Error

type Error struct {
	Message string
}

type Handler

type Handler interface {
	CreateWish(c *gin.Context) error
}

type Repository

type Repository interface {
	CreateWish(wish *CreateWishRequest) error
	GetWishByEmail(email string) (*Wish, error)
}

type Service

type Service interface {
	CreateWish(*CreateWishRequest) error
	GetWishByEmail(email string) (*Wish, error)
}

func NewService

func NewService(r Repository) Service

type Wish

type Wish struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Wish      string    `json:"wish"`
	CreatedAt time.Time `json:"created_at"`
}

Jump to

Keyboard shortcuts

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