v2.0.0 ae3e752

storage.go RawHistoryFolder

1package mocks
2
3import (
4	"io"
5	"github.com/stretchr/testify/mock"
6)
7
8// MockStorage is a mock implementation of registry.Storage
9type MockStorage struct {
10	mock.Mock
11}
12
13// Manifest operations
14func (m *MockStorage) GetManifest(name, reference string) ([]byte, string, error) {
15	args := m.Called(name, reference)
16	if args.Get(0) == nil {
17		return nil, "", args.Error(2)
18	}
19	return args.Get(0).([]byte), args.String(1), args.Error(2)
20}
21
22func (m *MockStorage) PutManifest(name, reference, contentType string, data []byte) error {
23	args := m.Called(name, reference, contentType, data)
24	return args.Error(0)
25}
26
27func (m *MockStorage) DeleteManifest(name, reference string) error {
28	args := m.Called(name, reference)
29	return args.Error(0)
30}
31
32// Blob operations
33func (m *MockStorage) GetBlob(digest string) (io.ReadCloser, error) {
34	args := m.Called(digest)
35	if args.Get(0) == nil {
36		return nil, args.Error(1)
37	}
38	return args.Get(0).(io.ReadCloser), args.Error(1)
39}
40
41func (m *MockStorage) GetBlobPath(digest string) (string, error) {
42	args := m.Called(digest)
43	return args.String(0), args.Error(1)
44}
45
46func (m *MockStorage) PutBlob(digest string, data io.Reader, size int64) error {
47	args := m.Called(digest, data, size)
48	return args.Error(0)
49}
50
51func (m *MockStorage) DeleteBlob(digest string) error {
52	args := m.Called(digest)
53	return args.Error(0)
54}
55
56func (m *MockStorage) BlobExists(digest string) bool {
57	args := m.Called(digest)
58	return args.Bool(0)
59}
60
61// Upload operations
62func (m *MockStorage) StartBlobUpload(name string) (string, error) {
63	args := m.Called(name)
64	return args.String(0), args.Error(1)
65}
66
67func (m *MockStorage) AppendBlobChunk(name, uuid string, chunk []byte) (int64, error) {
68	args := m.Called(name, uuid, chunk)
69	return args.Get(0).(int64), args.Error(1)
70}
71
72func (m *MockStorage) GetBlobUpload(uuid string) (io.WriteCloser, error) {
73	args := m.Called(uuid)
74	if args.Get(0) == nil {
75		return nil, args.Error(1)
76	}
77	return args.Get(0).(io.WriteCloser), args.Error(1)
78}
79
80func (m *MockStorage) FinishBlobUpload(uuid, digest string) error {
81	args := m.Called(uuid, digest)
82	return args.Error(0)
83}
84
85func (m *MockStorage) CancelBlobUpload(uuid string) error {
86	args := m.Called(uuid)
87	return args.Error(0)
88}
89
90// Tag operations
91func (m *MockStorage) ListTags(name string) ([]string, error) {
92	args := m.Called(name)
93	if args.Get(0) == nil {
94		return nil, args.Error(1)
95	}
96	return args.Get(0).([]string), args.Error(1)
97}
98
99// Repository operations
100func (m *MockStorage) ListRepositories() ([]string, error) {
101	args := m.Called()
102	if args.Get(0) == nil {
103		return nil, args.Error(1)
104	}
105	return args.Get(0).([]string), args.Error(1)
106}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close