4c321a089d
- serve sparse index and config.json for local cargo repos from a cargo_index table - add Web API publish, yank and unyank under the local repo api root - drop index lines when the crate file is deleted
25 lines
702 B
Go
25 lines
702 B
Go
package provider
|
|
|
|
import "context"
|
|
|
|
// CargoIndexEntry is one published crate version in a local cargo registry.
|
|
// Line is the sparse-index JSON line; Yanked is applied when it is served.
|
|
type CargoIndexEntry struct {
|
|
RepoName string
|
|
FilePath string
|
|
Name string
|
|
Version string
|
|
Line string
|
|
Yanked bool
|
|
}
|
|
|
|
// CargoIndexReader lists every version of one crate (matched case-insensitively).
|
|
// *database.DB satisfies it and CargoIndexDeleter.
|
|
type CargoIndexReader interface {
|
|
ListCargoIndexEntries(ctx context.Context, repoName, name string) ([]CargoIndexEntry, error)
|
|
}
|
|
|
|
type CargoIndexDeleter interface {
|
|
DeleteCargoIndexEntry(ctx context.Context, repoName, filePath string) error
|
|
}
|