services

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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