services

package
v0.9.18 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

type CreatePasteResponse struct {
	Slug string
	URL  string
}

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

Jump to

Keyboard shortcuts

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