handler

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNote

func CreateNote(srv service.NoteService) http.HandlerFunc

Handler for the sign-in endpoint

func GetPresignedUrls

func GetPresignedUrls(srv service.NoteService) http.HandlerFunc

Handler for the get presigned urls endpoint

func HardDeleteNote

func HardDeleteNote(srv service.NoteService) http.HandlerFunc

Handler for the delete note endpoint

func HealthCheckHandler

func HealthCheckHandler(w http.ResponseWriter, r *http.Request)

HealthCheckHandler handles HTTP requests for checking the health status of the server.

func ListNotesByUser

func ListNotesByUser(srv service.NoteService) http.HandlerFunc

Handler for the list notes endpoint

func ListTrashNotesByUser

func ListTrashNotesByUser(srv service.NoteService) http.HandlerFunc

Handler for the list trash notes endpoint

func Me

Handler for the me endpoint

func NotFoundHandler

func NotFoundHandler(w http.ResponseWriter, r *http.Request)

NotFoundHandler handles requests to non-existent resources.

func OpenApiHanlder

func OpenApiHanlder(w http.ResponseWriter, r *http.Request)

OpenApiHanlder handles requests for the OpenAPI specification.

func RestoreNote

func RestoreNote(srv service.NoteService) http.HandlerFunc

Handler for the update note endpoint

func SignIn

Handler for the sign-in endpoint

func SignOut

Handler for the sign-out endpoint

func SoftDeleteNote

func SoftDeleteNote(srv service.NoteService) http.HandlerFunc

Handler for the soft delete note endpoint

func UpdateNote

func UpdateNote(srv service.NoteService) http.HandlerFunc

Handler for the update note endpoint

Types

type CreateNoteRequest

type CreateNoteRequest struct {
	Title       string   `json:"title"`
	Content     string   `json:"content"`
	ObjectNames []string `json:"object_names"`
}

Represents the structure of the create note request

func (CreateNoteRequest) Validate

func (r CreateNoteRequest) Validate() map[string]string

Validates the create note request

type GetPresignedUrlsRequest

type GetPresignedUrlsRequest struct {
	ObjectNames []string `json:"object_names"`
}

Represents the structure of the get presigned urls request

func (GetPresignedUrlsRequest) Validate

func (r GetPresignedUrlsRequest) Validate() map[string]string

Validates the get presigned urls request

type HealthCheckResponse

type HealthCheckResponse struct {
	Status string `json:"status"`
}

HealthCheckResponse represents the structure of the health check response

type ListNotesResponse

type ListNotesResponse struct {
	Notes  *[]domain.Note `json:"notes"`
	Cursor time.Time      `json:"cursor"`
}

Represent the structure of the list notes response

type SignInRequest

type SignInRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Represents the structure of the sign-in request

func (SignInRequest) Validate

func (r SignInRequest) Validate() map[string]string

Validates the sign-in request

type UpdateNoteRequest

type UpdateNoteRequest struct {
	Title   string `json:"title"`
	Content string `json:"content"`
}

Represents the structure of the update note request

func (UpdateNoteRequest) Validate

func (r UpdateNoteRequest) Validate() map[string]string

Validates the update note request

Jump to

Keyboard shortcuts

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