httptransport

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalCreateResponse

func MarshalCreateResponse(res *usr_s.User, w http.ResponseWriter)

func MarshalDetailResponse

func MarshalDetailResponse(res *usr_s.User, w http.ResponseWriter)

func MarshalListAsSelectOptionResponse

func MarshalListAsSelectOptionResponse(res []*sub_s.UserAsSelectOption, w http.ResponseWriter)

func MarshalListResponse

func MarshalListResponse(res *sub_s.UserListResult, w http.ResponseWriter)

func MarshalOperationCreateCommentResponse

func MarshalOperationCreateCommentResponse(res *sub_s.User, w http.ResponseWriter)

func MarshalUpdateResponse

func MarshalUpdateResponse(res *usr_s.User, w http.ResponseWriter)

func UnmarshalCreateRequest

func UnmarshalCreateRequest(ctx context.Context, r *http.Request) (*usr_c.UserCreateRequestIDO, error)

func UnmarshalUpdateRequest

func UnmarshalUpdateRequest(ctx context.Context, r *http.Request) (*usr_c.UserUpdateRequestIDO, error)

func ValidateCreateRequest

func ValidateCreateRequest(dirtyData *usr_c.UserCreateRequestIDO) error

func ValidateOperationCreateCommentRequest

func ValidateOperationCreateCommentRequest(dirtyData *UserOperationCreateCommentRequest) error

func ValidateUpdateRequest

func ValidateUpdateRequest(dirtyData *usr_c.UserUpdateRequestIDO) error

Types

type Handler

type Handler struct {
	Logger     *slog.Logger
	Controller user_c.UserController
}

Handler Creates http request handler

func NewHandler

func NewHandler(loggerp *slog.Logger, c user_c.UserController) *Handler

NewHandler Constructor

func (*Handler) ArchiveByID

func (h *Handler) ArchiveByID(w http.ResponseWriter, r *http.Request, id string)

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteByID

func (h *Handler) DeleteByID(w http.ResponseWriter, r *http.Request, id string)

func (*Handler) GetByID

func (h *Handler) GetByID(w http.ResponseWriter, r *http.Request, id string)

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

func (*Handler) ListAsSelectOptions

func (h *Handler) ListAsSelectOptions(w http.ResponseWriter, r *http.Request)

func (*Handler) OperationCreateComment

func (h *Handler) OperationCreateComment(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateByID

func (h *Handler) UpdateByID(w http.ResponseWriter, r *http.Request, id string)

type UserOperationCreateCommentRequest

type UserOperationCreateCommentRequest struct {
	UserID  primitive.ObjectID `bson:"user_id" json:"user_id"`
	Content string             `bson:"content" json:"content"`
}

func UnmarshalOperationCreateCommentRequest

func UnmarshalOperationCreateCommentRequest(ctx context.Context, r *http.Request) (*UserOperationCreateCommentRequest, error)

Jump to

Keyboard shortcuts

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