Enable struct check
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
parent
dc53e37d98
commit
32e2260be2
4 changed files with 7 additions and 18 deletions
|
@ -4,6 +4,8 @@
|
||||||
"Sort": ["linter", "severity", "path", "line"],
|
"Sort": ["linter", "severity", "path", "line"],
|
||||||
"EnableGC": true,
|
"EnableGC": true,
|
||||||
"Enable": [
|
"Enable": [
|
||||||
|
"structcheck",
|
||||||
|
|
||||||
"gofmt",
|
"gofmt",
|
||||||
"golint",
|
"golint",
|
||||||
"vet"
|
"vet"
|
||||||
|
|
|
@ -14,15 +14,6 @@ const (
|
||||||
RouteNameCatalog = "catalog"
|
RouteNameCatalog = "catalog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var allEndpoints = []string{
|
|
||||||
RouteNameManifest,
|
|
||||||
RouteNameCatalog,
|
|
||||||
RouteNameTags,
|
|
||||||
RouteNameBlob,
|
|
||||||
RouteNameBlobUpload,
|
|
||||||
RouteNameBlobUploadChunk,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Router builds a gorilla router with named routes for the various API
|
// Router builds a gorilla router with named routes for the various API
|
||||||
// methods. This can be used directly by both server implementations and
|
// methods. This can be used directly by both server implementations and
|
||||||
// clients.
|
// clients.
|
||||||
|
|
|
@ -68,7 +68,6 @@ func NewAuthorizer(manager challenge.Manager, handlers ...AuthenticationHandler)
|
||||||
type endpointAuthorizer struct {
|
type endpointAuthorizer struct {
|
||||||
challenges challenge.Manager
|
challenges challenge.Manager
|
||||||
handlers []AuthenticationHandler
|
handlers []AuthenticationHandler
|
||||||
transport http.RoundTripper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ea *endpointAuthorizer) ModifyRequest(req *http.Request) error {
|
func (ea *endpointAuthorizer) ModifyRequest(req *http.Request) error {
|
||||||
|
@ -121,7 +120,6 @@ type clock interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type tokenHandler struct {
|
type tokenHandler struct {
|
||||||
header http.Header
|
|
||||||
creds CredentialStore
|
creds CredentialStore
|
||||||
transport http.RoundTripper
|
transport http.RoundTripper
|
||||||
clock clock
|
clock clock
|
||||||
|
|
|
@ -81,9 +81,8 @@ func NewRegistry(baseURL string, transport http.RoundTripper) (Registry, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type registry struct {
|
type registry struct {
|
||||||
client *http.Client
|
client *http.Client
|
||||||
ub *v2.URLBuilder
|
ub *v2.URLBuilder
|
||||||
context context.Context
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repositories returns a lexigraphically sorted catalog given a base URL. The 'entries' slice will be filled up to the size
|
// Repositories returns a lexigraphically sorted catalog given a base URL. The 'entries' slice will be filled up to the size
|
||||||
|
@ -152,10 +151,9 @@ func NewRepository(name reference.Named, baseURL string, transport http.RoundTri
|
||||||
}
|
}
|
||||||
|
|
||||||
type repository struct {
|
type repository struct {
|
||||||
client *http.Client
|
client *http.Client
|
||||||
ub *v2.URLBuilder
|
ub *v2.URLBuilder
|
||||||
context context.Context
|
name reference.Named
|
||||||
name reference.Named
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *repository) Named() reference.Named {
|
func (r *repository) Named() reference.Named {
|
||||||
|
|
Loading…
Reference in a new issue