Documentation ¶
Index ¶
- type FileService
- type PasteService
- func (s *PasteService) CreateNewPaste(ctx context.Context, burnAfter, readCount uint64, deepUrl uint8, secret string) (string, error)
- func (s *PasteService) DeletePaste(ctx context.Context, pasteID string, secret string) (bool, error)
- func (s *PasteService) GetPaste(ctx context.Context, pasteID string) (bool, error)
- func (s *PasteService) IsPasteExist(ctx context.Context, pasteID string) (bool, error)
- func (s *PasteService) SecretMatch(ctx context.Context, pasteID string, secret string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
func NewFileService ¶
func NewFileService(pasteRepo *repositories.PasteRepository, uploadDir, maxFileSize string) *FileService
type PasteService ¶
type PasteService struct {
// contains filtered or unexported fields
}
func NewPasteService ¶
func NewPasteService(pasteRepo *repositories.PasteRepository) *PasteService
NewPasteService creates a new instance of the PasteService
func (*PasteService) CreateNewPaste ¶
func (s *PasteService) CreateNewPaste(ctx context.Context, burnAfter, readCount uint64, deepUrl uint8, secret string) (string, error)
CreateNewPaste creates a new paste and returns the paste ID
func (*PasteService) DeletePaste ¶
func (s *PasteService) DeletePaste(ctx context.Context, pasteID string, secret string) (bool, error)
DeletePaste deletes a paste if the secret matches
func (*PasteService) GetPaste ¶
GetPaste retrieves a paste by ID, decrements its read count, and deletes it if the read count is exhausted
func (*PasteService) IsPasteExist ¶
IsPasteExist checks if a paste with the given ID exists
func (*PasteService) SecretMatch ¶
Click to show internal directories.
Click to hide internal directories.