Delete modules in case of breaking changes or invalid checksums, compatibility with go mod download (#10)
* add module invalidation via DELETE request * add go mod download vcs provider
This commit is contained in:
@@ -47,4 +47,15 @@ func (d disk) Get(ctx context.Context, module string, version vcs.Version) (Snap
|
||||
return s, err
|
||||
}
|
||||
|
||||
func (d disk) Del(ctx context.Context, module string, version vcs.Version) error {
|
||||
dir := string(d)
|
||||
s := Snapshot{Module: module, Version: version}
|
||||
err := os.Remove(filepath.Join(dir, s.Key()+".time"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Remove(filepath.Join(dir, s.Key()+".zip"))
|
||||
return err
|
||||
}
|
||||
|
||||
func (d disk) Close() error { return nil }
|
||||
|
||||
Reference in New Issue
Block a user