debanator/backend.go

26 lines
447 B
Go
Raw Normal View History

2023-05-01 01:22:25 +01:00
package debanator
import (
"io"
2023-05-01 21:28:28 +01:00
"net/http"
2023-05-01 01:22:25 +01:00
)
// A backend to search for packages in
type Backend interface {
2023-05-01 21:28:28 +01:00
GetFiles() ([]DebFile, error)
ServeFiles(string) http.Handler
2023-05-01 01:22:25 +01:00
}
2023-05-01 21:28:28 +01:00
type ReaderAtCloser interface {
io.ReaderAt
io.ReadCloser
}
// An abstract interface for reading a debfile. This could be coming from the local fs,
// a remote webdav share, etc...
type DebFile interface {
GetReader() (ReaderAtCloser, error)
GetName() string
}
2023-05-01 01:22:25 +01:00