Skip to content
Snippets Groups Projects
Unverified Commit fc89edaa authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Improve storage handling

parent 144a7cf3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,11 +10,14 @@ import (
)
 
type fsStorage struct {
rootDir string
}
 
var fsRootDir = flag.String("fs-root-dir", "examples/registry", "root directory")
 
func newFsStorage() storageObject {
return &fsStorage{}
}
func (f *fsStorage) fullPath(path string) string {
return filepath.Join(*fsRootDir, "docker", "registry", "v2", path)
}
Loading
Loading
Loading
Loading
@@ -28,7 +28,7 @@ func main() {
 
switch *storage {
case "filesystem":
currentStorage = &fsStorage{}
currentStorage = newFsStorage()
 
case "s3":
currentStorage = newS3Storage()
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ var s3RootDir = flag.String("s3-root-dir", "", "s3 root directory")
var s3Bucket = flag.String("s3-bucket", "", "s3 bucket")
var s3Region = flag.String("s3-region", "us-east-1", "s3 region")
 
func newS3Storage() *s3Storage {
func newS3Storage() storageObject {
sess, err := session.NewSession()
if err != nil {
panic(err)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment