@@ -50,6 +50,8 @@ type RegistryAPI interface {
50
50
GetServiceDocBytes (string ) ([]byte , error )
51
51
GetResourcesRegisterDocBytes (string ) ([]byte , error )
52
52
LoadProviderByName (string , string ) (Provider , error )
53
+ RemoveProviderVersion (string , string ) error
54
+ ClearProviderCache (string ) error
53
55
}
54
56
55
57
type RegistryConfig struct {
@@ -692,3 +694,17 @@ func (r *Registry) getLatestPublishedVersion(providerName string) (string, error
692
694
}
693
695
return latestVersion , nil
694
696
}
697
+
698
+ // RemoveProviderVersion removes a specific version of a provider
699
+ // e.g) RemoveProviderVersion("googleapis.com", "v23.09.00169")
700
+ func (r * Registry ) RemoveProviderVersion (providerId string , version string ) error {
701
+ providerPath := path .Join (r .getLocalDocRoot (), providerId , version )
702
+ return os .RemoveAll (providerPath )
703
+ }
704
+
705
+ // ClearProviderCache clears the cache for a specific provider
706
+ // e.g) ClearProviderCache("aws")
707
+ func (r * Registry ) ClearProviderCache (providerId string ) error {
708
+ cachePath := path .Join (r .getLocalDocRoot (), providerId )
709
+ return os .RemoveAll (cachePath )
710
+ }
0 commit comments