-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/acceptance-refactor
- Loading branch information
Showing
12 changed files
with
254 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cache | ||
|
||
import ( | ||
"context" | ||
"os" | ||
|
||
"github.com/docker/docker/client" | ||
) | ||
|
||
type BindCache struct { | ||
docker client.CommonAPIClient | ||
bind string | ||
} | ||
|
||
func NewBindCache(cacheType CacheInfo, dockerClient client.CommonAPIClient) *BindCache { | ||
return &BindCache{ | ||
bind: cacheType.Source, | ||
docker: dockerClient, | ||
} | ||
} | ||
|
||
func (c *BindCache) Name() string { | ||
return c.bind | ||
} | ||
|
||
func (c *BindCache) Clear(ctx context.Context) error { | ||
err := os.RemoveAll(c.bind) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func (c *BindCache) Type() Type { | ||
return Bind | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.