Initial import of https://github.com/docker/dhe-engine
This commit is contained in:
parent
e9de6f2a44
commit
d4f01b812c
31 changed files with 2000 additions and 0 deletions
36
docs/middleware/mocks/ManifestStore.go
Normal file
36
docs/middleware/mocks/ManifestStore.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package mocks
|
||||
|
||||
import "github.com/stretchr/testify/mock"
|
||||
|
||||
import "github.com/docker/distribution"
|
||||
import "github.com/docker/distribution/context"
|
||||
|
||||
type ManifestStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *ManifestStore) GetManifest(ctx context.Context, key string) ([]byte, error) {
|
||||
ret := m.Called(ctx, key)
|
||||
|
||||
var r0 []byte
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]byte)
|
||||
}
|
||||
r1 := ret.Error(1)
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
func (m *ManifestStore) PutManifest(ctx context.Context, repo, digest string, val distribution.Manifest) error {
|
||||
ret := m.Called(ctx, repo, digest, val)
|
||||
|
||||
r0 := ret.Error(0)
|
||||
|
||||
return r0
|
||||
}
|
||||
func (m *ManifestStore) DeleteManifest(ctx context.Context, key string) error {
|
||||
ret := m.Called(ctx, key)
|
||||
|
||||
r0 := ret.Error(0)
|
||||
|
||||
return r0
|
||||
}
|
27
docs/middleware/mocks/Store.go
Normal file
27
docs/middleware/mocks/Store.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/dhe-deploy/manager/schema"
|
||||
)
|
||||
|
||||
type Store struct {
|
||||
*ManifestStore
|
||||
*TagStore
|
||||
}
|
||||
|
||||
func NewStore() *Store {
|
||||
return &Store{
|
||||
&ManifestStore{},
|
||||
&TagStore{},
|
||||
}
|
||||
}
|
||||
|
||||
func (Store) CreateEvent(event *schema.Event) error { return nil }
|
||||
func (Store) GetEvents(requestedPageEncoded string, perPage uint, publishedBefore, publishedAfter *time.Time, queryingUserId, actorId, eventType string, isAdmin bool) (events []schema.Event, nextPageEncoded string, err error) {
|
||||
return []schema.Event{}, "", nil
|
||||
}
|
||||
func (Store) Subscribe(schema.EventReactor) chan bool {
|
||||
return nil
|
||||
}
|
55
docs/middleware/mocks/TagStore.go
Normal file
55
docs/middleware/mocks/TagStore.go
Normal file
|
@ -0,0 +1,55 @@
|
|||
package mocks
|
||||
|
||||
import "github.com/stretchr/testify/mock"
|
||||
|
||||
import "github.com/docker/distribution"
|
||||
import "github.com/docker/distribution/context"
|
||||
|
||||
type TagStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *TagStore) GetTag(ctx context.Context, repo distribution.Repository, key string) (distribution.Descriptor, error) {
|
||||
ret := m.Called(ctx, repo, key)
|
||||
|
||||
r0 := ret.Get(0).(distribution.Descriptor)
|
||||
r1 := ret.Error(1)
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
func (m *TagStore) PutTag(ctx context.Context, repo distribution.Repository, key string, val distribution.Descriptor) error {
|
||||
ret := m.Called(ctx, repo, key, val)
|
||||
|
||||
r0 := ret.Error(0)
|
||||
|
||||
return r0
|
||||
}
|
||||
func (m *TagStore) DeleteTag(ctx context.Context, repo distribution.Repository, key string) error {
|
||||
ret := m.Called(ctx, repo, key)
|
||||
|
||||
r0 := ret.Error(0)
|
||||
|
||||
return r0
|
||||
}
|
||||
func (m *TagStore) AllTags(ctx context.Context, repo distribution.Repository) ([]string, error) {
|
||||
ret := m.Called(ctx, repo)
|
||||
|
||||
var r0 []string
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
r1 := ret.Error(1)
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
func (m *TagStore) LookupTags(ctx context.Context, repo distribution.Repository, digest distribution.Descriptor) ([]string, error) {
|
||||
ret := m.Called(ctx, repo, digest)
|
||||
|
||||
var r0 []string
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
r1 := ret.Error(1)
|
||||
|
||||
return r0, r1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue