Documentation
¶
Index ¶
- type CreatePasteRequest
- type CreatePasteResponse
- type PasteService
- func (s *PasteService) CreatePaste(req CreatePasteRequest) (*CreatePasteResponse, error)
- func (s *PasteService) DeletePaste(slug string) error
- func (s *PasteService) GenerateSlug() (string, error)
- func (s *PasteService) GetPaste(slug string) (*models.Paste, error)
- func (s *PasteService) GetPasteContent(slug string) ([]byte, error)
- func (s *PasteService) IncrementReadCount(slug string) error
- func (s *PasteService) ValidateCustomSlug(slug string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePasteRequest ¶
type CreatePasteRequest struct {
Content []byte
Filename string
ContentType string
CustomSlug string
BurnAfterRead bool
TTL time.Duration
}
CreatePasteRequest represents a request to create a paste
type CreatePasteResponse ¶
CreatePasteResponse represents the response from creating a paste
type PasteService ¶
type PasteService struct {
// contains filtered or unexported fields
}
PasteService handles paste business logic
func NewPasteService ¶
func NewPasteService(store storage.PasteStore, config *config.Config) *PasteService
NewPasteService creates a new paste service
func (*PasteService) CreatePaste ¶
func (s *PasteService) CreatePaste(req CreatePasteRequest) (*CreatePasteResponse, error)
CreatePaste creates a new paste
func (*PasteService) DeletePaste ¶
func (s *PasteService) DeletePaste(slug string) error
DeletePaste deletes a paste
func (*PasteService) GenerateSlug ¶
func (s *PasteService) GenerateSlug() (string, error)
GenerateSlug generates a unique slug for a paste
func (*PasteService) GetPaste ¶
func (s *PasteService) GetPaste(slug string) (*models.Paste, error)
GetPaste retrieves a paste by slug
func (*PasteService) GetPasteContent ¶
func (s *PasteService) GetPasteContent(slug string) ([]byte, error)
GetPasteContent retrieves paste content
func (*PasteService) IncrementReadCount ¶
func (s *PasteService) IncrementReadCount(slug string) error
IncrementReadCount increments the read count for a paste
func (*PasteService) ValidateCustomSlug ¶
func (s *PasteService) ValidateCustomSlug(slug string) error
ValidateCustomSlug validates and checks if a custom slug is available
Click to show internal directories.
Click to hide internal directories.