Documentation ¶ Index ¶ type PasteData type S3Storage func NewS3Storage(bucket, region string) (*S3Storage, error) func (storage *S3Storage) DeletePaste(hash string) error func (storage *S3Storage) GetPaste(hash string) (*PasteData, error) func (storage *S3Storage) UploadPaste(data *PasteData) (string, error) type Storage Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type PasteData ¶ type PasteData struct { Hash string // Unique identifier for the post (hash) Text string // The actual text content of the post } type S3Storage ¶ type S3Storage struct { Bucket string S3 *s3.Client } func NewS3Storage ¶ func NewS3Storage(bucket, region string) (*S3Storage, error) func (*S3Storage) DeletePaste ¶ func (storage *S3Storage) DeletePaste(hash string) error DeletePaste deletes a paste from S3 func (*S3Storage) GetPaste ¶ func (storage *S3Storage) GetPaste(hash string) (*PasteData, error) GetPaste retrieves a paste from S3 and decodes it into PasteData func (*S3Storage) UploadPaste ¶ func (storage *S3Storage) UploadPaste(data *PasteData) (string, error) UploadPaste uploads paste data to S3 and returns the upload location URL type Storage ¶ type Storage interface { GetPaste(hash string) (*PasteData, error) // Retrieve post data from blob storage UploadPaste(data *PasteData) (string, error) // Upload post data to blob storage DeletePaste(hash string) error } Source Files ¶ View all Source files s3_storage.go storage.go Click to show internal directories. Click to hide internal directories.