1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00
pasty/internal/pastes/repository.go

15 lines
352 B
Go
Raw Normal View History

2023-06-07 19:25:28 +03:00
package pastes
import (
"context"
"time"
)
type Repository interface {
ListIDs(ctx context.Context) ([]string, error)
FindByID(ctx context.Context, id string) (*Paste, error)
Upsert(ctx context.Context, paste *Paste) error
DeleteByID(ctx context.Context, id string) error
DeleteOlderThan(ctx context.Context, age time.Duration) (int, error)
}