Merge pull request #167 from stevvooe/registry-handler-package

registry: reorganize package layout
This commit is contained in:
Olivier Gambier 2015-02-11 13:27:39 -08:00
commit 2000759d51
106 changed files with 110 additions and 107 deletions

View File

@ -20,7 +20,7 @@ import (
"regexp"
"text/template"
"github.com/docker/distribution/api/v2"
"github.com/docker/distribution/registry/api/v2"
)
var spaceRegex = regexp.MustCompile(`\n\s*`)

View File

@ -7,8 +7,8 @@ import (
"os"
log "github.com/Sirupsen/logrus"
"github.com/docker/distribution/storagedriver/azure"
"github.com/docker/distribution/storagedriver/ipc"
"github.com/docker/distribution/registry/storage/driver/azure"
"github.com/docker/distribution/registry/storage/driver/ipc"
)
// An out-of-process Azure Storage driver, intended to be run by ipc.NewDriverClient

View File

@ -8,8 +8,8 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/storagedriver/filesystem"
"github.com/docker/distribution/storagedriver/ipc"
"github.com/docker/distribution/registry/storage/driver/filesystem"
"github.com/docker/distribution/registry/storage/driver/ipc"
)
// An out-of-process filesystem driver, intended to be run by ipc.NewDriverClient

View File

@ -4,8 +4,8 @@ package main
import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/storagedriver/ipc"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/registry/storage/driver/ipc"
)
// An out-of-process inmemory driver, intended to be run by ipc.NewDriverClient

View File

@ -8,8 +8,8 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/storagedriver/ipc"
"github.com/docker/distribution/storagedriver/s3"
"github.com/docker/distribution/registry/storage/driver/ipc"
"github.com/docker/distribution/registry/storage/driver/s3"
)
// An out-of-process S3 driver, intended to be run by ipc.NewDriverClient

View File

@ -10,16 +10,16 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/bugsnag/bugsnag-go"
_ "github.com/docker/distribution/auth/silly"
_ "github.com/docker/distribution/auth/token"
"github.com/docker/distribution/configuration"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/registry"
_ "github.com/docker/distribution/storagedriver/filesystem"
_ "github.com/docker/distribution/storagedriver/inmemory"
_ "github.com/docker/distribution/storagedriver/s3"
_ "github.com/docker/distribution/registry/auth/silly"
_ "github.com/docker/distribution/registry/auth/token"
"github.com/docker/distribution/registry/handlers"
_ "github.com/docker/distribution/registry/storage/driver/filesystem"
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
_ "github.com/docker/distribution/registry/storage/driver/s3"
"github.com/docker/distribution/version"
"github.com/gorilla/handlers"
gorhandlers "github.com/gorilla/handlers"
"github.com/yvasiyarov/gorelic"
"golang.org/x/net/context"
)
@ -50,9 +50,9 @@ func main() {
ctx = context.WithValue(ctx, "version", version.Version)
ctx = ctxu.WithLogger(ctx, ctxu.GetLogger(ctx, "version"))
app := registry.NewApp(ctx, *config)
app := handlers.NewApp(ctx, *config)
handler := configureReporting(app)
handler = handlers.CombinedLoggingHandler(os.Stdout, handler)
handler = gorhandlers.CombinedLoggingHandler(os.Stdout, handler)
if config.HTTP.Debug.Addr != "" {
go debugServer(config.HTTP.Debug.Addr)
@ -118,7 +118,7 @@ func logLevel(level configuration.Loglevel) log.Level {
return l
}
func configureReporting(app *registry.App) http.Handler {
func configureReporting(app *handlers.App) http.Handler {
var handler http.Handler = app
if app.Config.Reporting.Bugsnag.APIKey != "" {

View File

@ -12,8 +12,8 @@ import (
"net/http"
"strings"
"github.com/docker/distribution/auth"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/registry/auth"
"golang.org/x/net/context"
)

View File

@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"
"github.com/docker/distribution/auth"
"github.com/docker/distribution/registry/auth"
"golang.org/x/net/context"
)

View File

@ -11,8 +11,8 @@ import (
"os"
"strings"
"github.com/docker/distribution/auth"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/registry/auth"
"github.com/docker/libtrust"
"golang.org/x/net/context"
)

View File

@ -13,7 +13,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/docker/libtrust"
"github.com/docker/distribution/auth"
"github.com/docker/distribution/registry/auth"
)
const (

View File

@ -15,7 +15,7 @@ import (
"testing"
"time"
"github.com/docker/distribution/auth"
"github.com/docker/distribution/registry/auth"
"github.com/docker/libtrust"
"golang.org/x/net/context"
)

View File

@ -9,9 +9,9 @@ import (
"regexp"
"strconv"
"github.com/docker/distribution/api/v2"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/registry/api/v2"
)
// Client implements the client interface to the registry http api

3
registry/doc.go Normal file
View File

@ -0,0 +1,3 @@
// Package registry is a placeholder package for registry interface
// destinations and utilities.
package registry

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"bytes"
@ -14,11 +14,11 @@ import (
"reflect"
"testing"
"github.com/docker/distribution/api/v2"
"github.com/docker/distribution/configuration"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
_ "github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/api/v2"
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/testutil"
"github.com/docker/libtrust"
"github.com/gorilla/handlers"

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"fmt"
@ -7,14 +7,14 @@ import (
"os"
"code.google.com/p/go-uuid/uuid"
"github.com/docker/distribution/api/v2"
"github.com/docker/distribution/auth"
"github.com/docker/distribution/configuration"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/storage/notifications"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/factory"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/auth"
"github.com/docker/distribution/registry/storage"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/factory"
"github.com/docker/distribution/registry/storage/notifications"
"github.com/gorilla/mux"
"golang.org/x/net/context"
)

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"encoding/json"
@ -7,11 +7,11 @@ import (
"net/url"
"testing"
"github.com/docker/distribution/api/v2"
_ "github.com/docker/distribution/auth/silly"
"github.com/docker/distribution/configuration"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/api/v2"
_ "github.com/docker/distribution/registry/auth/silly"
"github.com/docker/distribution/registry/storage"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"golang.org/x/net/context"
)

View File

@ -1,6 +1,6 @@
// +build go1.4
package registry
package handlers
import (
"net/http"

View File

@ -1,6 +1,6 @@
// +build !go1.4
package registry
package handlers
import (
"encoding/base64"

View File

@ -1,13 +1,13 @@
package registry
package handlers
import (
"fmt"
"net/http"
"github.com/docker/distribution/api/v2"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage"
"golang.org/x/net/context"
)

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"encoding/json"

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"crypto/hmac"

View File

@ -1,4 +1,4 @@
package registry
package handlers
import "testing"

View File

@ -1,15 +1,15 @@
package registry
package handlers
import (
"encoding/json"
"fmt"
"net/http"
"github.com/docker/distribution/api/v2"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage"
"github.com/gorilla/handlers"
)

View File

@ -1,12 +1,12 @@
package registry
package handlers
import (
"net/http"
"github.com/docker/distribution/api/v2"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage"
"github.com/gorilla/handlers"
)

View File

@ -1,4 +1,4 @@
package registry
package handlers
import (
"fmt"
@ -7,10 +7,10 @@ import (
"net/url"
"os"
"github.com/docker/distribution/api/v2"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage"
"github.com/gorilla/handlers"
)

View File

@ -1,11 +1,11 @@
package registry
package handlers
import (
"encoding/json"
"net/http"
"github.com/docker/distribution/api/v2"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage"
"github.com/gorilla/handlers"
)

View File

@ -5,7 +5,7 @@ import (
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"golang.org/x/net/context"
)

View File

@ -10,7 +10,7 @@ import (
"time"
"github.com/AdRoll/goamz/cloudfront"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// cloudFrontLayerHandler provides an simple implementation of layerHandler that

View File

@ -5,7 +5,7 @@ import (
"net/http"
"time"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// delegateLayerHandler provides a simple implementation of layerHandler that

View File

@ -11,9 +11,9 @@ import (
"strings"
"time"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/base"
"github.com/docker/distribution/storagedriver/factory"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/base"
"github.com/docker/distribution/registry/storage/driver/factory"
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
)

View File

@ -6,8 +6,8 @@ import (
"strings"
"testing"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/testsuites"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/testsuites"
. "gopkg.in/check.v1"
)

View File

@ -40,7 +40,7 @@ package base
import (
"io"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// Base provides a wrapper around a storagedriver implementation that provides

View File

@ -3,7 +3,7 @@ package factory
import (
"fmt"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// driverFactories stores an internal mapping between storage driver names and their respective

View File

@ -1,4 +1,4 @@
package storagedriver
package driver
import "time"

View File

@ -9,9 +9,9 @@ import (
"path"
"time"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/base"
"github.com/docker/distribution/storagedriver/factory"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/base"
"github.com/docker/distribution/registry/storage/driver/factory"
)
const driverName = "filesystem"

View File

@ -5,8 +5,8 @@ import (
"os"
"testing"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/testsuites"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/testsuites"
. "gopkg.in/check.v1"
)

View File

@ -8,9 +8,9 @@ import (
"sync"
"time"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/base"
"github.com/docker/distribution/storagedriver/factory"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/base"
"github.com/docker/distribution/registry/storage/driver/factory"
)
const driverName = "inmemory"

View File

@ -3,8 +3,8 @@ package inmemory
import (
"testing"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/testsuites"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/testsuites"
"gopkg.in/check.v1"
)

View File

@ -13,7 +13,7 @@ import (
"os/exec"
"syscall"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/libchan"
"github.com/docker/libchan/spdy"
)

View File

@ -7,7 +7,7 @@ import (
"io"
"reflect"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/libchan"
)

View File

@ -10,7 +10,7 @@ import (
"os"
"reflect"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/libchan"
"github.com/docker/libchan/spdy"
)

View File

@ -26,9 +26,9 @@ import (
"github.com/AdRoll/goamz/aws"
"github.com/AdRoll/goamz/s3"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/base"
"github.com/docker/distribution/storagedriver/factory"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/base"
"github.com/docker/distribution/registry/storage/driver/factory"
)
const driverName = "s3"

View File

@ -7,8 +7,8 @@ import (
"testing"
"github.com/AdRoll/goamz/aws"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/testsuites"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/testsuites"
"gopkg.in/check.v1"
)

View File

@ -1,4 +1,4 @@
package storagedriver
package driver
import (
"errors"

View File

@ -14,7 +14,7 @@ import (
"testing"
"time"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"gopkg.in/check.v1"
)

View File

@ -9,7 +9,7 @@ import (
"os"
"time"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// TODO(stevvooe): Set an optimal buffer size here. We'll have to

View File

@ -10,7 +10,7 @@ import (
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/storage/driver/inmemory"
)
func TestSimpleRead(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"io"
"os"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// fileWriter implements a remote file writer backed by a storage driver.

View File

@ -8,7 +8,7 @@ import (
"testing"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/storage/driver/inmemory"
)
// TestSimpleWrite takes the fileWriter through common write operations

View File

@ -10,8 +10,8 @@ import (
"testing"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver"
"github.com/docker/distribution/storagedriver/inmemory"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/testutil"
"golang.org/x/net/context"
)

View File

@ -4,7 +4,7 @@ import (
"fmt"
"net/http"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
// LayerHandler provides middleware for serving the contents of a Layer.

View File

@ -7,7 +7,7 @@ import (
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
)
type layerStore struct {

View File

@ -9,7 +9,7 @@ import (
"github.com/Sirupsen/logrus"
ctxu "github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storagedriver"
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/docker/pkg/tarsum"
)

View File

@ -8,7 +8,7 @@ import (
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/testutil"
"github.com/docker/libtrust"
"golang.org/x/net/context"

View File

@ -8,7 +8,7 @@ import (
"code.google.com/p/go-uuid/uuid"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/storage"
)
type bridge struct {

View File

@ -4,7 +4,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/registry/storage"
)
// ManifestListener describes a set of methods for listening to events related to manifests.

View File

@ -7,8 +7,8 @@ import (
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/storage"
"github.com/docker/distribution/storagedriver/inmemory"
"github.com/docker/distribution/registry/storage"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/testutil"
"github.com/docker/libtrust"
"golang.org/x/net/context"

Some files were not shown because too many files have changed in this diff Show More