user

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(
	log *slog.Logger, d Deleter,
) func(w http.ResponseWriter, r *http.Request)

Delete @Summary Delete User @Tags user @Security ApiKeyAuth @Description Delete User from system @Accept json @Produce json @Param input body Request true "user id" @Success 200 {object} Response @Router /api/v1/user [delete]

func Get

func Get(
	log *slog.Logger, g Getter,
) func(w http.ResponseWriter, r *http.Request)

Get @Summary Get User @Tags user @Security ApiKeyAuth @Description Get User from system @Accept json @Produce json @Param input body Request true "user id" @Success 200 {object} Response @Router /api/v1/user/{id} [get]

func Post

func Post(
	log *slog.Logger, c Creater,
) func(w http.ResponseWriter, r *http.Request)

Post @Summary Post User @Tags user @Security ApiKeyAuth @Description Create user at system @Accept json @Produce json @Param input body Request true "user info" @Success 200 {object} Response @Router /api/v1/user [post]

func Update

func Update(
	log *slog.Logger, u Updater,
) func(w http.ResponseWriter, r *http.Request)

Update @Summary Update User @Tags user @Security ApiKeyAuth @Description Update all info of a user at system @Accept json @Produce json @Param input body Request true "all user info" @Success 200 {object} Response @Router /api/v1/user [put]

Types

type Creater

type Creater interface {
	Create(context.Context, dto.UserCreateReq) (id string, err error)
}

type DeleteResp

type DeleteResp struct {
	resp.Response
}

type Deleter

type Deleter interface {
	Delete(context.Context, dto.UserDeleteReq) error
}

type GetResp

type GetResp struct {
	Email        string `json:"email"`
	PasswordHash []byte `json:"password_hash"`
	IsActive     bool   `json:"is_active"`
}

type Getter

type Getter interface {
	Get(context.Context, dto.UserGetReq) (*model.User, error)
}

type PostResp

type PostResp struct {
	Id string `json:"id"`
}

type Provider

type Provider interface {
	Deleter
	Creater
	Getter
	Updater
}

type UpdateResp

type UpdateResp struct {
	resp.Response
}

type Updater

type Updater interface {
	Update(context.Context, dto.UserUpdateReq) error
}

Jump to

Keyboard shortcuts

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