Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFileTooLarge = errors.New("file too large")
)
Functions ¶
This section is empty.
Types ¶
type FileBackend ¶
type FileBackend struct { // root is the root directory where files are stored Root string `yaml:"root"` // maxSize is the maximum size of a submission MaxSize int64 `yaml:"max_size"` // contains filtered or unexported fields }
func DefaultFileBackend ¶
func DefaultFileBackend(root string) (*FileBackend, error)
Returns a file backend with sensible defaults
func NewFileBackend ¶
func NewFileBackend(root string, maxSize int64, pathGen PathGenFunc) (*FileBackend, error)
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
MemoryBackend is a backend that stores files in memory
func NewMemoryBackend ¶
func NewMemoryBackend() *MemoryBackend
type PathGenFunc ¶
type PathGenFunc func() string
type PgxBackend ¶
type PgxBackend struct {
// contains filtered or unexported fields
}
PgxBackend is a backend that stores pastes in a PostgreSQL database. It uses pgx as the driver.
func NewPostgresBackend ¶
func NewPostgresBackend(ctx context.Context, connString string, pgf PathGenFunc, createTables bool) (*PgxBackend, error)
NewPostgresBackend creates a new PostgresBackend. If createTables is true, the necessary tables will be created if they do not exist.
type RedisBackend ¶
type RedisBackend struct {
// contains filtered or unexported fields
}
func NewRedisBackend ¶
func NewRedisBackend(ctx context.Context, pgf PathGenFunc, client *redis.Client) *RedisBackend
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
func NewS3Backend ¶
type SQLiteBackend ¶
type SQLiteBackend struct {
// contains filtered or unexported fields
}
func NewSQLiteBackend ¶
func NewSQLiteBackend(db *sql.DB, pgf PathGenFunc, createTables bool) (*SQLiteBackend, error)
Click to show internal directories.
Click to hide internal directories.