Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePasteRequest ¶
type PasteHandler ¶
type PasteHandler struct {
// contains filtered or unexported fields
}
func NewPasteHandler ¶
func NewPasteHandler(pasteService *PasteService) *PasteHandler
func (*PasteHandler) CreatePaste ¶
func (h *PasteHandler) CreatePaste(w http.ResponseWriter, r *http.Request) error
CreatePaste creates a new text paste @Summary Create a paste @Description Creates a text paste (code, logs, plain text) @Tags paste @Accept json @Produce json @Param paste body CreatePasteRequest true "Paste content and options" @Success 201 {string} string "Paste URL" @Failure 400 "Invalid request" @Failure 500 "Internal server error" @Router /api/pastes [post]
func (*PasteHandler) GetPasteByShort ¶
func (h *PasteHandler) GetPasteByShort(w http.ResponseWriter, r *http.Request) error
GetPasteByShort retrieves and serves the paste content @Summary Get paste by short code @Description Returns the paste content as text/plain (or encrypted data as JSON if encrypted) @Tags paste @Param short path string true "Short code (6 characters)" @Success 200 {string} string "Paste content" @Failure 404 @Failure 422 @Router /p/{short} [get]
type PasteRepo ¶
type PasteRepo struct {
// contains filtered or unexported fields
}
func NewPasteRepo ¶
type PasteResponse ¶
type PasteResponse struct {
Data string `json:"data"`
}
type PasteService ¶
type PasteService struct {
// contains filtered or unexported fields
}
func NewPasteService ¶
func NewPasteService(pasteRepo *PasteRepo) *PasteService
func (*PasteService) CreatePaste ¶
func (*PasteService) DeletePaste ¶
func (s *PasteService) DeletePaste(short string) error