diff --git a/Taskfile.yml b/Taskfile.yml index 76e12f74..200940ea 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -87,6 +87,7 @@ tasks: - cmd: go test -count=1 github.com/drone/drone/store/secret/global - cmd: go test -count=1 github.com/drone/drone/store/stage - cmd: go test -count=1 github.com/drone/drone/store/step + - cmd: go test -count=1 github.com/drone/drone/store/template - cmd: go test -count=1 github.com/drone/drone/store/user - cmd: docker kill mysql @@ -120,6 +121,7 @@ tasks: - cmd: go test -count=1 github.com/drone/drone/store/secret/global - cmd: go test -count=1 github.com/drone/drone/store/stage - cmd: go test -count=1 github.com/drone/drone/store/step + - cmd: go test -count=1 github.com/drone/drone/store/template - cmd: go test -count=1 github.com/drone/drone/store/user - cmd: docker kill postgres silent: true diff --git a/core/template.go b/core/template.go index 803fa0d3..7d406bd2 100644 --- a/core/template.go +++ b/core/template.go @@ -32,23 +32,27 @@ type ( } Template struct { - Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Data []byte `json:"data,omitempty"` - Created int64 `json:"created,omitempty"` - Updated int64 `json:"updated,omitempty"` + Id int64 `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Namespace string `json:"namespace,omitempty"` + Data string `json:"data,omitempty"` + Created int64 `json:"created,omitempty"` + Updated int64 `json:"updated,omitempty"` } // TemplateStore manages repository templates. TemplateStore interface { + // List returns template list at org level + List(ctx context.Context, namespace string) ([]*Template, error) + // ListAll returns templates list from the datastore. ListAll(ctx context.Context) ([]*Template, error) // Find returns a template from the datastore. Find(ctx context.Context, id int64) (*Template, error) - // FindName returns a template from the datastore by name - FindName(ctx context.Context, name string) (*Template, error) + // FindName returns a template from the data store + FindName(ctx context.Context, name string, namespace string) (*Template, error) // Create persists a new template to the datastore. Create(ctx context.Context, template *Template) error diff --git a/handler/api/api.go b/handler/api/api.go index cb4588a1..645ce011 100644 --- a/handler/api/api.go +++ b/handler/api/api.go @@ -15,10 +15,11 @@ package api import ( - "github.com/drone/drone/handler/api/template" "net/http" "os" + "github.com/drone/drone/handler/api/template" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/acl" "github.com/drone/drone/handler/api/auth" @@ -358,12 +359,13 @@ func (s Server) Handler() http.Handler { }) r.Route("/templates", func(r chi.Router) { - r.With(acl.CheckMembership(s.Orgs, false)).Get("/", template.HandleList(s.Template)) + r.With(acl.CheckMembership(s.Orgs, false)).Get("/", template.HandleListAll(s.Template)) r.With(acl.CheckMembership(s.Orgs, true)).Post("/", template.HandleCreate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, false)).Get("/{name}", template.HandleFind(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Put("/{name}", template.HandleUpdate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Patch("/{name}", template.HandleUpdate(s.Template)) - r.With(acl.CheckMembership(s.Orgs, true)).Delete("/{name}", template.HandleDelete(s.Template)) + r.With(acl.CheckMembership(s.Orgs, false)).Get("/{namespace}", template.HandleList(s.Template)) + r.With(acl.CheckMembership(s.Orgs, false)).Get("/{namespace}/{name}", template.HandleFind(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Put("/{namespace}/{name}", template.HandleUpdate(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Patch("/{namespace}/{name}", template.HandleUpdate(s.Template)) + r.With(acl.CheckMembership(s.Orgs, true)).Delete("/{namespace}/{name}", template.HandleDelete(s.Template)) }) r.Route("/system", func(r chi.Router) { diff --git a/handler/api/template/all.go b/handler/api/template/all.go new file mode 100644 index 00000000..370fadc4 --- /dev/null +++ b/handler/api/template/all.go @@ -0,0 +1,26 @@ +// Copyright 2019 Drone.IO Inc. All rights reserved. +// Use of this source code is governed by the Drone Non-Commercial License +// that can be found in the LICENSE file. + +// +build !oss + +package template + +import ( + "github.com/drone/drone/core" + "github.com/drone/drone/handler/api/render" + "net/http" +) + +// HandleListAll returns an http.HandlerFunc that writes a json-encoded +// list of templates to the response body. +func HandleListAll(templateStore core.TemplateStore) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + list, err := templateStore.ListAll(r.Context()) + if err != nil { + render.NotFound(w, err) + return + } + render.JSON(w, list, 200) + } +} diff --git a/handler/api/template/all_test.go b/handler/api/template/all_test.go new file mode 100644 index 00000000..33ceea53 --- /dev/null +++ b/handler/api/template/all_test.go @@ -0,0 +1,82 @@ +// Copyright 2019 Drone.IO Inc. All rights reserved. +// Use of this source code is governed by the Drone Non-Commercial License +// that can be found in the LICENSE file. + +// +build !oss + +package template + +import ( + "context" + "encoding/json" + "github.com/drone/drone/core" + "github.com/drone/drone/handler/api/errors" + "github.com/drone/drone/mock" + "github.com/go-chi/chi" + "github.com/golang/mock/gomock" + "github.com/google/go-cmp/cmp" + "net/http" + "net/http/httptest" + "testing" +) + +var ( + dummyTemplate = &core.Template{ + Name: "my_template", + Data: "my_data", + Created: 1, + Updated: 2, + Namespace: "my_org", + } + dummyTemplateList = []*core.Template{ + dummyTemplate, + } +) + +func TestHandleAll(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + + templates := mock.NewMockTemplateStore(controller) + templates.EXPECT().ListAll(gomock.Any()).Return(dummyTemplateList, nil) + + c := new(chi.Context) + + w := httptest.NewRecorder() + r := httptest.NewRequest("GET", "/", nil) + r = r.WithContext( + context.WithValue(context.Background(), chi.RouteCtxKey, c), + ) + + HandleListAll(templates).ServeHTTP(w, r) + if got, want := w.Code, http.StatusOK; want != got { + t.Errorf("Want response code %d, got %d", want, got) + } +} + +func TestHandleAll_TemplateListErr(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + + templates := mock.NewMockTemplateStore(controller) + templates.EXPECT().ListAll(gomock.Any()).Return(nil, errors.ErrNotFound) + + c := new(chi.Context) + + w := httptest.NewRecorder() + r := httptest.NewRequest("GET", "/", nil) + r = r.WithContext( + context.WithValue(context.Background(), chi.RouteCtxKey, c), + ) + + HandleListAll(templates).ServeHTTP(w, r) + if got, want := w.Code, http.StatusNotFound; want != got { + t.Errorf("Want response code %d, got %d", want, got) + } + + got, want := new(errors.Error), errors.ErrNotFound + json.NewDecoder(w.Body).Decode(got) + if diff := cmp.Diff(got, want); len(diff) != 0 { + t.Errorf(diff) + } +} diff --git a/handler/api/template/create.go b/handler/api/template/create.go index 276112df..e4294f21 100644 --- a/handler/api/template/create.go +++ b/handler/api/template/create.go @@ -14,8 +14,9 @@ import ( ) type templateInput struct { - Name string `json:"name"` - Data []byte `json:"data"` + Name string `json:"name"` + Data string `json:"data"` + Namespace string `json:"namespace"` } // HandleCreate returns an http.HandlerFunc that processes http @@ -30,8 +31,9 @@ func HandleCreate(templateStore core.TemplateStore) http.HandlerFunc { } t := &core.Template{ - Name: in.Name, - Data: in.Data, + Name: in.Name, + Data: in.Data, + Namespace: in.Namespace, } err = t.Validate() diff --git a/handler/api/template/create_test.go b/handler/api/template/create_test.go index 0266154b..1a27e1a8 100644 --- a/handler/api/template/create_test.go +++ b/handler/api/template/create_test.go @@ -51,7 +51,7 @@ func TestHandleCreate_ValidationErrorName(t *testing.T) { c := new(chi.Context) in := new(bytes.Buffer) - json.NewEncoder(in).Encode(&core.Template{Name: "", Data: []byte("my_data")}) + json.NewEncoder(in).Encode(&core.Template{Name: "", Data: "my_data"}) w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", in) @@ -77,7 +77,7 @@ func TestHandleCreate_ValidationErrorData(t *testing.T) { c := new(chi.Context) in := new(bytes.Buffer) - json.NewEncoder(in).Encode(&core.Template{Name: "my_template", Data: nil}) + json.NewEncoder(in).Encode(&core.Template{Name: "my_template", Data: ""}) w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", in) diff --git a/handler/api/template/delete.go b/handler/api/template/delete.go index 4dca6da9..66ae16ca 100644 --- a/handler/api/template/delete.go +++ b/handler/api/template/delete.go @@ -18,9 +18,10 @@ import ( func HandleDelete(template core.TemplateStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var ( - name = chi.URLParam(r, "name") + name = chi.URLParam(r, "name") + namespace = chi.URLParam(r, "namespace") ) - s, err := template.FindName(r.Context(), name) + s, err := template.FindName(r.Context(), name, namespace) if err != nil { render.NotFound(w, err) return diff --git a/handler/api/template/delete_test.go b/handler/api/template/delete_test.go index cf36a7f2..9fb9cd01 100644 --- a/handler/api/template/delete_test.go +++ b/handler/api/template/delete_test.go @@ -24,11 +24,12 @@ func TestHandleDelete(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(dummyTemplate, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(dummyTemplate, nil) template.EXPECT().Delete(gomock.Any(), dummyTemplate).Return(nil) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) @@ -47,10 +48,11 @@ func TestHandleDelete_TemplateNotFound(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(nil, errors.ErrNotFound) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(nil, errors.ErrNotFound) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) @@ -75,11 +77,12 @@ func TestHandleDelete_DeleteError(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(dummyTemplate, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(dummyTemplate, nil) template.EXPECT().Delete(gomock.Any(), dummyTemplate).Return(errors.ErrNotFound) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) diff --git a/handler/api/template/find.go b/handler/api/template/find.go index f233cb9c..6b4bc853 100644 --- a/handler/api/template/find.go +++ b/handler/api/template/find.go @@ -18,9 +18,10 @@ import ( func HandleFind(templateStore core.TemplateStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var ( - name = chi.URLParam(r, "name") + name = chi.URLParam(r, "name") + namespace = chi.URLParam(r, "namespace") ) - template, err := templateStore.FindName(r.Context(), name) + template, err := templateStore.FindName(r.Context(), name, namespace) if err != nil { render.NotFound(w, err) return diff --git a/handler/api/template/find_test.go b/handler/api/template/find_test.go index 5b8de11b..9db1a5eb 100644 --- a/handler/api/template/find_test.go +++ b/handler/api/template/find_test.go @@ -24,10 +24,11 @@ func TestHandleFind(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(dummyTemplate, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(dummyTemplate, nil) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) @@ -46,10 +47,11 @@ func TestHandleFind_TemplateNotFound(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(nil, errors.ErrNotFound) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(nil, errors.ErrNotFound) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) diff --git a/handler/api/template/list.go b/handler/api/template/list.go index 5c0960e2..a600b435 100644 --- a/handler/api/template/list.go +++ b/handler/api/template/list.go @@ -9,14 +9,16 @@ package template import ( "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" + "github.com/go-chi/chi" "net/http" ) // HandleList returns an http.HandlerFunc that writes a json-encoded -// list of templates to the response body. +// list of templates to the response body by namespace func HandleList(templateStore core.TemplateStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - list, err := templateStore.ListAll(r.Context()) + namespace := chi.URLParam(r, "namespace") + list, err := templateStore.List(r.Context(), namespace) if err != nil { render.NotFound(w, err) return diff --git a/handler/api/template/list_test.go b/handler/api/template/list_test.go index 6cb55628..6ddae146 100644 --- a/handler/api/template/list_test.go +++ b/handler/api/template/list_test.go @@ -1,15 +1,12 @@ +package template + // Copyright 2019 Drone.IO Inc. All rights reserved. // Use of this source code is governed by the Drone Non-Commercial License // that can be found in the LICENSE file. -// +build !oss - -package template - import ( "context" "encoding/json" - "github.com/drone/drone/core" "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" @@ -20,26 +17,15 @@ import ( "testing" ) -var ( - dummyTemplate = &core.Template{ - Name: "my_template", - Data: []byte("my_data"), - Created: 1, - Updated: 2, - } - dummyTemplateList = []*core.Template{ - dummyTemplate, - } -) - func TestHandleList(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() templates := mock.NewMockTemplateStore(controller) - templates.EXPECT().ListAll(gomock.Any()).Return(dummyTemplateList, nil) + templates.EXPECT().List(gomock.Any(), dummyTemplate.Namespace).Return(dummyTemplateList, nil) c := new(chi.Context) + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) @@ -58,9 +44,10 @@ func TestHandleList_TemplateListErr(t *testing.T) { defer controller.Finish() templates := mock.NewMockTemplateStore(controller) - templates.EXPECT().ListAll(gomock.Any()).Return(nil, errors.ErrNotFound) + templates.EXPECT().List(gomock.Any(), dummyTemplate.Namespace).Return(nil, errors.ErrNotFound) c := new(chi.Context) + c.URLParams.Add("namespace", "my_org") w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", nil) diff --git a/handler/api/template/update.go b/handler/api/template/update.go index f1879783..0f58b669 100644 --- a/handler/api/template/update.go +++ b/handler/api/template/update.go @@ -13,8 +13,8 @@ import ( ) type templateUpdate struct { - Data *[]byte `json:"data"` - Updated *int64 `json:"Updated"` + Data *string `json:"data"` + Namespace *string `json:"namespace"` } // HandleUpdate returns an http.HandlerFunc that processes http @@ -22,7 +22,8 @@ type templateUpdate struct { func HandleUpdate(templateStore core.TemplateStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var ( - name = chi.URLParam(r, "name") + name = chi.URLParam(r, "name") + namespace = chi.URLParam(r, "namespace") ) in := new(templateUpdate) @@ -32,7 +33,7 @@ func HandleUpdate(templateStore core.TemplateStore) http.HandlerFunc { return } - s, err := templateStore.FindName(r.Context(), name) + s, err := templateStore.FindName(r.Context(), name, namespace) if err != nil { render.NotFound(w, err) return @@ -41,8 +42,8 @@ func HandleUpdate(templateStore core.TemplateStore) http.HandlerFunc { if in.Data != nil { s.Data = *in.Data } - if in.Updated != nil { - s.Updated = *in.Updated + if in.Namespace != nil { + s.Namespace = *in.Namespace } err = s.Validate() diff --git a/handler/api/template/update_test.go b/handler/api/template/update_test.go index 3396400b..5538ce27 100644 --- a/handler/api/template/update_test.go +++ b/handler/api/template/update_test.go @@ -26,11 +26,12 @@ func TestHandleUpdate(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(dummyTemplate, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(dummyTemplate, nil) template.EXPECT().Update(gomock.Any(), gomock.Any()).Return(nil) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") in := new(bytes.Buffer) json.NewEncoder(in).Encode(dummyTemplate) @@ -52,10 +53,11 @@ func TestHandleUpdate_ValidationErrorData(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(&core.Template{Name: "my_template"}, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(&core.Template{Name: "my_template"}, nil) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") in := new(bytes.Buffer) json.NewEncoder(in).Encode(&core.Secret{Data: ""}) @@ -83,10 +85,11 @@ func TestHandleUpdate_TemplateNotFound(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(nil, errors.ErrNotFound) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(nil, errors.ErrNotFound) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") in := new(bytes.Buffer) json.NewEncoder(in).Encode(&core.Secret{}) @@ -114,14 +117,15 @@ func TestHandleUpdate_UpdateError(t *testing.T) { defer controller.Finish() template := mock.NewMockTemplateStore(controller) - template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name).Return(&core.Template{Name: "my_template"}, nil) + template.EXPECT().FindName(gomock.Any(), dummyTemplate.Name, dummyTemplate.Namespace).Return(&core.Template{Name: "my_template"}, nil) template.EXPECT().Update(gomock.Any(), gomock.Any()).Return(errors.ErrNotFound) c := new(chi.Context) c.URLParams.Add("name", "my_template") + c.URLParams.Add("namespace", "my_org") in := new(bytes.Buffer) - json.NewEncoder(in).Encode(&core.Template{Data: []byte("my_data")}) + json.NewEncoder(in).Encode(&core.Template{Data: "my_data"}) w := httptest.NewRecorder() r := httptest.NewRequest("GET", "/", in) diff --git a/mock/mock_gen.go b/mock/mock_gen.go deleted file mode 100644 index 97ca3712..00000000 --- a/mock/mock_gen.go +++ /dev/null @@ -1,2865 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/drone/drone/core (interfaces: Pubsub,Canceler,ConvertService,ValidateService,NetrcService,Renewer,HookParser,UserService,RepositoryService,CommitService,StatusService,HookService,FileService,Batcher,BuildStore,CronStore,LogStore,PermStore,SecretStore,GlobalSecretStore,StageStore,StepStore,RepositoryStore,UserStore,Scheduler,Session,OrganizationService,SecretService,RegistryService,ConfigService,Transferer,Triggerer,Syncer,LogStream,WebhookSender,LicenseService,TemplateStore) - -// Package mock is a generated GoMock package. -package mock - -import ( - context "context" - io "io" - http "net/http" - reflect "reflect" - - core "github.com/drone/drone/core" - gomock "github.com/golang/mock/gomock" -) - -// MockPubsub is a mock of Pubsub interface. -type MockPubsub struct { - ctrl *gomock.Controller - recorder *MockPubsubMockRecorder -} - -// MockPubsubMockRecorder is the mock recorder for MockPubsub. -type MockPubsubMockRecorder struct { - mock *MockPubsub -} - -// NewMockPubsub creates a new mock instance. -func NewMockPubsub(ctrl *gomock.Controller) *MockPubsub { - mock := &MockPubsub{ctrl: ctrl} - mock.recorder = &MockPubsubMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockPubsub) EXPECT() *MockPubsubMockRecorder { - return m.recorder -} - -// Publish mocks base method. -func (m *MockPubsub) Publish(arg0 context.Context, arg1 *core.Message) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Publish", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Publish indicates an expected call of Publish. -func (mr *MockPubsubMockRecorder) Publish(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockPubsub)(nil).Publish), arg0, arg1) -} - -// Subscribe mocks base method. -func (m *MockPubsub) Subscribe(arg0 context.Context) (<-chan *core.Message, <-chan error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Subscribe", arg0) - ret0, _ := ret[0].(<-chan *core.Message) - ret1, _ := ret[1].(<-chan error) - return ret0, ret1 -} - -// Subscribe indicates an expected call of Subscribe. -func (mr *MockPubsubMockRecorder) Subscribe(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockPubsub)(nil).Subscribe), arg0) -} - -// Subscribers mocks base method. -func (m *MockPubsub) Subscribers() int { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Subscribers") - ret0, _ := ret[0].(int) - return ret0 -} - -// Subscribers indicates an expected call of Subscribers. -func (mr *MockPubsubMockRecorder) Subscribers() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribers", reflect.TypeOf((*MockPubsub)(nil).Subscribers)) -} - -// MockCanceler is a mock of Canceler interface. -type MockCanceler struct { - ctrl *gomock.Controller - recorder *MockCancelerMockRecorder -} - -// MockCancelerMockRecorder is the mock recorder for MockCanceler. -type MockCancelerMockRecorder struct { - mock *MockCanceler -} - -// NewMockCanceler creates a new mock instance. -func NewMockCanceler(ctrl *gomock.Controller) *MockCanceler { - mock := &MockCanceler{ctrl: ctrl} - mock.recorder = &MockCancelerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCanceler) EXPECT() *MockCancelerMockRecorder { - return m.recorder -} - -// Cancel mocks base method. -func (m *MockCanceler) Cancel(arg0 context.Context, arg1 *core.Repository, arg2 *core.Build) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Cancel", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Cancel indicates an expected call of Cancel. -func (mr *MockCancelerMockRecorder) Cancel(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockCanceler)(nil).Cancel), arg0, arg1, arg2) -} - -// CancelPending mocks base method. -func (m *MockCanceler) CancelPending(arg0 context.Context, arg1 *core.Repository, arg2 *core.Build) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CancelPending", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// CancelPending indicates an expected call of CancelPending. -func (mr *MockCancelerMockRecorder) CancelPending(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelPending", reflect.TypeOf((*MockCanceler)(nil).CancelPending), arg0, arg1, arg2) -} - -// MockConvertService is a mock of ConvertService interface. -type MockConvertService struct { - ctrl *gomock.Controller - recorder *MockConvertServiceMockRecorder -} - -// MockConvertServiceMockRecorder is the mock recorder for MockConvertService. -type MockConvertServiceMockRecorder struct { - mock *MockConvertService -} - -// NewMockConvertService creates a new mock instance. -func NewMockConvertService(ctrl *gomock.Controller) *MockConvertService { - mock := &MockConvertService{ctrl: ctrl} - mock.recorder = &MockConvertServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockConvertService) EXPECT() *MockConvertServiceMockRecorder { - return m.recorder -} - -// Convert mocks base method. -func (m *MockConvertService) Convert(arg0 context.Context, arg1 *core.ConvertArgs) (*core.Config, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Convert", arg0, arg1) - ret0, _ := ret[0].(*core.Config) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Convert indicates an expected call of Convert. -func (mr *MockConvertServiceMockRecorder) Convert(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Convert", reflect.TypeOf((*MockConvertService)(nil).Convert), arg0, arg1) -} - -// MockValidateService is a mock of ValidateService interface. -type MockValidateService struct { - ctrl *gomock.Controller - recorder *MockValidateServiceMockRecorder -} - -// MockValidateServiceMockRecorder is the mock recorder for MockValidateService. -type MockValidateServiceMockRecorder struct { - mock *MockValidateService -} - -// NewMockValidateService creates a new mock instance. -func NewMockValidateService(ctrl *gomock.Controller) *MockValidateService { - mock := &MockValidateService{ctrl: ctrl} - mock.recorder = &MockValidateServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockValidateService) EXPECT() *MockValidateServiceMockRecorder { - return m.recorder -} - -// Validate mocks base method. -func (m *MockValidateService) Validate(arg0 context.Context, arg1 *core.ValidateArgs) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Validate", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Validate indicates an expected call of Validate. -func (mr *MockValidateServiceMockRecorder) Validate(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockValidateService)(nil).Validate), arg0, arg1) -} - -// MockNetrcService is a mock of NetrcService interface. -type MockNetrcService struct { - ctrl *gomock.Controller - recorder *MockNetrcServiceMockRecorder -} - -// MockNetrcServiceMockRecorder is the mock recorder for MockNetrcService. -type MockNetrcServiceMockRecorder struct { - mock *MockNetrcService -} - -// NewMockNetrcService creates a new mock instance. -func NewMockNetrcService(ctrl *gomock.Controller) *MockNetrcService { - mock := &MockNetrcService{ctrl: ctrl} - mock.recorder = &MockNetrcServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockNetrcService) EXPECT() *MockNetrcServiceMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockNetrcService) Create(arg0 context.Context, arg1 *core.User, arg2 *core.Repository) (*core.Netrc, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Netrc) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create. -func (mr *MockNetrcServiceMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockNetrcService)(nil).Create), arg0, arg1, arg2) -} - -// MockRenewer is a mock of Renewer interface. -type MockRenewer struct { - ctrl *gomock.Controller - recorder *MockRenewerMockRecorder -} - -// MockRenewerMockRecorder is the mock recorder for MockRenewer. -type MockRenewerMockRecorder struct { - mock *MockRenewer -} - -// NewMockRenewer creates a new mock instance. -func NewMockRenewer(ctrl *gomock.Controller) *MockRenewer { - mock := &MockRenewer{ctrl: ctrl} - mock.recorder = &MockRenewerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockRenewer) EXPECT() *MockRenewerMockRecorder { - return m.recorder -} - -// Renew mocks base method. -func (m *MockRenewer) Renew(arg0 context.Context, arg1 *core.User, arg2 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Renew", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Renew indicates an expected call of Renew. -func (mr *MockRenewerMockRecorder) Renew(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Renew", reflect.TypeOf((*MockRenewer)(nil).Renew), arg0, arg1, arg2) -} - -// MockHookParser is a mock of HookParser interface. -type MockHookParser struct { - ctrl *gomock.Controller - recorder *MockHookParserMockRecorder -} - -// MockHookParserMockRecorder is the mock recorder for MockHookParser. -type MockHookParserMockRecorder struct { - mock *MockHookParser -} - -// NewMockHookParser creates a new mock instance. -func NewMockHookParser(ctrl *gomock.Controller) *MockHookParser { - mock := &MockHookParser{ctrl: ctrl} - mock.recorder = &MockHookParserMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockHookParser) EXPECT() *MockHookParserMockRecorder { - return m.recorder -} - -// Parse mocks base method. -func (m *MockHookParser) Parse(arg0 *http.Request, arg1 func(string) string) (*core.Hook, *core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Parse", arg0, arg1) - ret0, _ := ret[0].(*core.Hook) - ret1, _ := ret[1].(*core.Repository) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// Parse indicates an expected call of Parse. -func (mr *MockHookParserMockRecorder) Parse(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Parse", reflect.TypeOf((*MockHookParser)(nil).Parse), arg0, arg1) -} - -// MockUserService is a mock of UserService interface. -type MockUserService struct { - ctrl *gomock.Controller - recorder *MockUserServiceMockRecorder -} - -// MockUserServiceMockRecorder is the mock recorder for MockUserService. -type MockUserServiceMockRecorder struct { - mock *MockUserService -} - -// NewMockUserService creates a new mock instance. -func NewMockUserService(ctrl *gomock.Controller) *MockUserService { - mock := &MockUserService{ctrl: ctrl} - mock.recorder = &MockUserServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUserService) EXPECT() *MockUserServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockUserService) Find(arg0 context.Context, arg1, arg2 string) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockUserServiceMockRecorder) Find(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockUserService)(nil).Find), arg0, arg1, arg2) -} - -// FindLogin mocks base method. -func (m *MockUserService) FindLogin(arg0 context.Context, arg1 *core.User, arg2 string) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindLogin", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindLogin indicates an expected call of FindLogin. -func (mr *MockUserServiceMockRecorder) FindLogin(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindLogin", reflect.TypeOf((*MockUserService)(nil).FindLogin), arg0, arg1, arg2) -} - -// MockRepositoryService is a mock of RepositoryService interface. -type MockRepositoryService struct { - ctrl *gomock.Controller - recorder *MockRepositoryServiceMockRecorder -} - -// MockRepositoryServiceMockRecorder is the mock recorder for MockRepositoryService. -type MockRepositoryServiceMockRecorder struct { - mock *MockRepositoryService -} - -// NewMockRepositoryService creates a new mock instance. -func NewMockRepositoryService(ctrl *gomock.Controller) *MockRepositoryService { - mock := &MockRepositoryService{ctrl: ctrl} - mock.recorder = &MockRepositoryServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockRepositoryService) EXPECT() *MockRepositoryServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockRepositoryService) Find(arg0 context.Context, arg1 *core.User, arg2 string) (*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockRepositoryServiceMockRecorder) Find(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockRepositoryService)(nil).Find), arg0, arg1, arg2) -} - -// FindPerm mocks base method. -func (m *MockRepositoryService) FindPerm(arg0 context.Context, arg1 *core.User, arg2 string) (*core.Perm, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindPerm", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Perm) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindPerm indicates an expected call of FindPerm. -func (mr *MockRepositoryServiceMockRecorder) FindPerm(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindPerm", reflect.TypeOf((*MockRepositoryService)(nil).FindPerm), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockRepositoryService) List(arg0 context.Context, arg1 *core.User) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockRepositoryServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRepositoryService)(nil).List), arg0, arg1) -} - -// MockCommitService is a mock of CommitService interface. -type MockCommitService struct { - ctrl *gomock.Controller - recorder *MockCommitServiceMockRecorder -} - -// MockCommitServiceMockRecorder is the mock recorder for MockCommitService. -type MockCommitServiceMockRecorder struct { - mock *MockCommitService -} - -// NewMockCommitService creates a new mock instance. -func NewMockCommitService(ctrl *gomock.Controller) *MockCommitService { - mock := &MockCommitService{ctrl: ctrl} - mock.recorder = &MockCommitServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCommitService) EXPECT() *MockCommitServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockCommitService) Find(arg0 context.Context, arg1 *core.User, arg2, arg3 string) (*core.Commit, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*core.Commit) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockCommitServiceMockRecorder) Find(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockCommitService)(nil).Find), arg0, arg1, arg2, arg3) -} - -// FindRef mocks base method. -func (m *MockCommitService) FindRef(arg0 context.Context, arg1 *core.User, arg2, arg3 string) (*core.Commit, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindRef", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*core.Commit) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindRef indicates an expected call of FindRef. -func (mr *MockCommitServiceMockRecorder) FindRef(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindRef", reflect.TypeOf((*MockCommitService)(nil).FindRef), arg0, arg1, arg2, arg3) -} - -// ListChanges mocks base method. -func (m *MockCommitService) ListChanges(arg0 context.Context, arg1 *core.User, arg2, arg3, arg4 string) ([]*core.Change, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListChanges", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].([]*core.Change) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListChanges indicates an expected call of ListChanges. -func (mr *MockCommitServiceMockRecorder) ListChanges(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListChanges", reflect.TypeOf((*MockCommitService)(nil).ListChanges), arg0, arg1, arg2, arg3, arg4) -} - -// MockStatusService is a mock of StatusService interface. -type MockStatusService struct { - ctrl *gomock.Controller - recorder *MockStatusServiceMockRecorder -} - -// MockStatusServiceMockRecorder is the mock recorder for MockStatusService. -type MockStatusServiceMockRecorder struct { - mock *MockStatusService -} - -// NewMockStatusService creates a new mock instance. -func NewMockStatusService(ctrl *gomock.Controller) *MockStatusService { - mock := &MockStatusService{ctrl: ctrl} - mock.recorder = &MockStatusServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStatusService) EXPECT() *MockStatusServiceMockRecorder { - return m.recorder -} - -// Send mocks base method. -func (m *MockStatusService) Send(arg0 context.Context, arg1 *core.User, arg2 *core.StatusInput) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Send", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Send indicates an expected call of Send. -func (mr *MockStatusServiceMockRecorder) Send(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockStatusService)(nil).Send), arg0, arg1, arg2) -} - -// MockHookService is a mock of HookService interface. -type MockHookService struct { - ctrl *gomock.Controller - recorder *MockHookServiceMockRecorder -} - -// MockHookServiceMockRecorder is the mock recorder for MockHookService. -type MockHookServiceMockRecorder struct { - mock *MockHookService -} - -// NewMockHookService creates a new mock instance. -func NewMockHookService(ctrl *gomock.Controller) *MockHookService { - mock := &MockHookService{ctrl: ctrl} - mock.recorder = &MockHookServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockHookService) EXPECT() *MockHookServiceMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockHookService) Create(arg0 context.Context, arg1 *core.User, arg2 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockHookServiceMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockHookService)(nil).Create), arg0, arg1, arg2) -} - -// Delete mocks base method. -func (m *MockHookService) Delete(arg0 context.Context, arg1 *core.User, arg2 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockHookServiceMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockHookService)(nil).Delete), arg0, arg1, arg2) -} - -// MockFileService is a mock of FileService interface. -type MockFileService struct { - ctrl *gomock.Controller - recorder *MockFileServiceMockRecorder -} - -// MockFileServiceMockRecorder is the mock recorder for MockFileService. -type MockFileServiceMockRecorder struct { - mock *MockFileService -} - -// NewMockFileService creates a new mock instance. -func NewMockFileService(ctrl *gomock.Controller) *MockFileService { - mock := &MockFileService{ctrl: ctrl} - mock.recorder = &MockFileServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockFileService) EXPECT() *MockFileServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockFileService) Find(arg0 context.Context, arg1 *core.User, arg2, arg3, arg4, arg5 string) (*core.File, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1, arg2, arg3, arg4, arg5) - ret0, _ := ret[0].(*core.File) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockFileServiceMockRecorder) Find(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockFileService)(nil).Find), arg0, arg1, arg2, arg3, arg4, arg5) -} - -// MockBatcher is a mock of Batcher interface. -type MockBatcher struct { - ctrl *gomock.Controller - recorder *MockBatcherMockRecorder -} - -// MockBatcherMockRecorder is the mock recorder for MockBatcher. -type MockBatcherMockRecorder struct { - mock *MockBatcher -} - -// NewMockBatcher creates a new mock instance. -func NewMockBatcher(ctrl *gomock.Controller) *MockBatcher { - mock := &MockBatcher{ctrl: ctrl} - mock.recorder = &MockBatcherMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockBatcher) EXPECT() *MockBatcherMockRecorder { - return m.recorder -} - -// Batch mocks base method. -func (m *MockBatcher) Batch(arg0 context.Context, arg1 *core.User, arg2 *core.Batch) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Batch", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Batch indicates an expected call of Batch. -func (mr *MockBatcherMockRecorder) Batch(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Batch", reflect.TypeOf((*MockBatcher)(nil).Batch), arg0, arg1, arg2) -} - -// MockBuildStore is a mock of BuildStore interface. -type MockBuildStore struct { - ctrl *gomock.Controller - recorder *MockBuildStoreMockRecorder -} - -// MockBuildStoreMockRecorder is the mock recorder for MockBuildStore. -type MockBuildStoreMockRecorder struct { - mock *MockBuildStore -} - -// NewMockBuildStore creates a new mock instance. -func NewMockBuildStore(ctrl *gomock.Controller) *MockBuildStore { - mock := &MockBuildStore{ctrl: ctrl} - mock.recorder = &MockBuildStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockBuildStore) EXPECT() *MockBuildStoreMockRecorder { - return m.recorder -} - -// Count mocks base method. -func (m *MockBuildStore) Count(arg0 context.Context) (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Count", arg0) - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Count indicates an expected call of Count. -func (mr *MockBuildStoreMockRecorder) Count(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockBuildStore)(nil).Count), arg0) -} - -// Create mocks base method. -func (m *MockBuildStore) Create(arg0 context.Context, arg1 *core.Build, arg2 []*core.Stage) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockBuildStoreMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockBuildStore)(nil).Create), arg0, arg1, arg2) -} - -// Delete mocks base method. -func (m *MockBuildStore) Delete(arg0 context.Context, arg1 *core.Build) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockBuildStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBuildStore)(nil).Delete), arg0, arg1) -} - -// DeleteBranch mocks base method. -func (m *MockBuildStore) DeleteBranch(arg0 context.Context, arg1 int64, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteBranch", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteBranch indicates an expected call of DeleteBranch. -func (mr *MockBuildStoreMockRecorder) DeleteBranch(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBranch", reflect.TypeOf((*MockBuildStore)(nil).DeleteBranch), arg0, arg1, arg2) -} - -// DeleteDeploy mocks base method. -func (m *MockBuildStore) DeleteDeploy(arg0 context.Context, arg1 int64, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteDeploy", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteDeploy indicates an expected call of DeleteDeploy. -func (mr *MockBuildStoreMockRecorder) DeleteDeploy(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDeploy", reflect.TypeOf((*MockBuildStore)(nil).DeleteDeploy), arg0, arg1, arg2) -} - -// DeletePull mocks base method. -func (m *MockBuildStore) DeletePull(arg0 context.Context, arg1 int64, arg2 int) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeletePull", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeletePull indicates an expected call of DeletePull. -func (mr *MockBuildStoreMockRecorder) DeletePull(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePull", reflect.TypeOf((*MockBuildStore)(nil).DeletePull), arg0, arg1, arg2) -} - -// Find mocks base method. -func (m *MockBuildStore) Find(arg0 context.Context, arg1 int64) (*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockBuildStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockBuildStore)(nil).Find), arg0, arg1) -} - -// FindNumber mocks base method. -func (m *MockBuildStore) FindNumber(arg0 context.Context, arg1, arg2 int64) (*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindNumber", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindNumber indicates an expected call of FindNumber. -func (mr *MockBuildStoreMockRecorder) FindNumber(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindNumber", reflect.TypeOf((*MockBuildStore)(nil).FindNumber), arg0, arg1, arg2) -} - -// FindRef mocks base method. -func (m *MockBuildStore) FindRef(arg0 context.Context, arg1 int64, arg2 string) (*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindRef", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindRef indicates an expected call of FindRef. -func (mr *MockBuildStoreMockRecorder) FindRef(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindRef", reflect.TypeOf((*MockBuildStore)(nil).FindRef), arg0, arg1, arg2) -} - -// LatestBranches mocks base method. -func (m *MockBuildStore) LatestBranches(arg0 context.Context, arg1 int64) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestBranches", arg0, arg1) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestBranches indicates an expected call of LatestBranches. -func (mr *MockBuildStoreMockRecorder) LatestBranches(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestBranches", reflect.TypeOf((*MockBuildStore)(nil).LatestBranches), arg0, arg1) -} - -// LatestDeploys mocks base method. -func (m *MockBuildStore) LatestDeploys(arg0 context.Context, arg1 int64) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestDeploys", arg0, arg1) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestDeploys indicates an expected call of LatestDeploys. -func (mr *MockBuildStoreMockRecorder) LatestDeploys(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestDeploys", reflect.TypeOf((*MockBuildStore)(nil).LatestDeploys), arg0, arg1) -} - -// LatestPulls mocks base method. -func (m *MockBuildStore) LatestPulls(arg0 context.Context, arg1 int64) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LatestPulls", arg0, arg1) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LatestPulls indicates an expected call of LatestPulls. -func (mr *MockBuildStoreMockRecorder) LatestPulls(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestPulls", reflect.TypeOf((*MockBuildStore)(nil).LatestPulls), arg0, arg1) -} - -// List mocks base method. -func (m *MockBuildStore) List(arg0 context.Context, arg1 int64, arg2, arg3 int) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockBuildStoreMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockBuildStore)(nil).List), arg0, arg1, arg2, arg3) -} - -// ListRef mocks base method. -func (m *MockBuildStore) ListRef(arg0 context.Context, arg1 int64, arg2 string, arg3, arg4 int) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListRef", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListRef indicates an expected call of ListRef. -func (mr *MockBuildStoreMockRecorder) ListRef(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRef", reflect.TypeOf((*MockBuildStore)(nil).ListRef), arg0, arg1, arg2, arg3, arg4) -} - -// Pending mocks base method. -func (m *MockBuildStore) Pending(arg0 context.Context) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Pending", arg0) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Pending indicates an expected call of Pending. -func (mr *MockBuildStoreMockRecorder) Pending(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pending", reflect.TypeOf((*MockBuildStore)(nil).Pending), arg0) -} - -// Purge mocks base method. -func (m *MockBuildStore) Purge(arg0 context.Context, arg1, arg2 int64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Purge", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Purge indicates an expected call of Purge. -func (mr *MockBuildStoreMockRecorder) Purge(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Purge", reflect.TypeOf((*MockBuildStore)(nil).Purge), arg0, arg1, arg2) -} - -// Running mocks base method. -func (m *MockBuildStore) Running(arg0 context.Context) ([]*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Running", arg0) - ret0, _ := ret[0].([]*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Running indicates an expected call of Running. -func (mr *MockBuildStoreMockRecorder) Running(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Running", reflect.TypeOf((*MockBuildStore)(nil).Running), arg0) -} - -// Update mocks base method. -func (m *MockBuildStore) Update(arg0 context.Context, arg1 *core.Build) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockBuildStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockBuildStore)(nil).Update), arg0, arg1) -} - -// MockCronStore is a mock of CronStore interface. -type MockCronStore struct { - ctrl *gomock.Controller - recorder *MockCronStoreMockRecorder -} - -// MockCronStoreMockRecorder is the mock recorder for MockCronStore. -type MockCronStoreMockRecorder struct { - mock *MockCronStore -} - -// NewMockCronStore creates a new mock instance. -func NewMockCronStore(ctrl *gomock.Controller) *MockCronStore { - mock := &MockCronStore{ctrl: ctrl} - mock.recorder = &MockCronStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCronStore) EXPECT() *MockCronStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockCronStore) Create(arg0 context.Context, arg1 *core.Cron) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockCronStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockCronStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockCronStore) Delete(arg0 context.Context, arg1 *core.Cron) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockCronStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockCronStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockCronStore) Find(arg0 context.Context, arg1 int64) (*core.Cron, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Cron) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockCronStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockCronStore)(nil).Find), arg0, arg1) -} - -// FindName mocks base method. -func (m *MockCronStore) FindName(arg0 context.Context, arg1 int64, arg2 string) (*core.Cron, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindName", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Cron) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindName indicates an expected call of FindName. -func (mr *MockCronStoreMockRecorder) FindName(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindName", reflect.TypeOf((*MockCronStore)(nil).FindName), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockCronStore) List(arg0 context.Context, arg1 int64) ([]*core.Cron, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Cron) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockCronStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockCronStore)(nil).List), arg0, arg1) -} - -// Ready mocks base method. -func (m *MockCronStore) Ready(arg0 context.Context, arg1 int64) ([]*core.Cron, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Ready", arg0, arg1) - ret0, _ := ret[0].([]*core.Cron) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Ready indicates an expected call of Ready. -func (mr *MockCronStoreMockRecorder) Ready(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockCronStore)(nil).Ready), arg0, arg1) -} - -// Update mocks base method. -func (m *MockCronStore) Update(arg0 context.Context, arg1 *core.Cron) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockCronStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockCronStore)(nil).Update), arg0, arg1) -} - -// MockLogStore is a mock of LogStore interface. -type MockLogStore struct { - ctrl *gomock.Controller - recorder *MockLogStoreMockRecorder -} - -// MockLogStoreMockRecorder is the mock recorder for MockLogStore. -type MockLogStoreMockRecorder struct { - mock *MockLogStore -} - -// NewMockLogStore creates a new mock instance. -func NewMockLogStore(ctrl *gomock.Controller) *MockLogStore { - mock := &MockLogStore{ctrl: ctrl} - mock.recorder = &MockLogStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockLogStore) EXPECT() *MockLogStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockLogStore) Create(arg0 context.Context, arg1 int64, arg2 io.Reader) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockLogStoreMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockLogStore)(nil).Create), arg0, arg1, arg2) -} - -// Delete mocks base method. -func (m *MockLogStore) Delete(arg0 context.Context, arg1 int64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockLogStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockLogStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockLogStore) Find(arg0 context.Context, arg1 int64) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockLogStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockLogStore)(nil).Find), arg0, arg1) -} - -// Update mocks base method. -func (m *MockLogStore) Update(arg0 context.Context, arg1 int64, arg2 io.Reader) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockLogStoreMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockLogStore)(nil).Update), arg0, arg1, arg2) -} - -// MockPermStore is a mock of PermStore interface. -type MockPermStore struct { - ctrl *gomock.Controller - recorder *MockPermStoreMockRecorder -} - -// MockPermStoreMockRecorder is the mock recorder for MockPermStore. -type MockPermStoreMockRecorder struct { - mock *MockPermStore -} - -// NewMockPermStore creates a new mock instance. -func NewMockPermStore(ctrl *gomock.Controller) *MockPermStore { - mock := &MockPermStore{ctrl: ctrl} - mock.recorder = &MockPermStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockPermStore) EXPECT() *MockPermStoreMockRecorder { - return m.recorder -} - -// Delete mocks base method. -func (m *MockPermStore) Delete(arg0 context.Context, arg1 *core.Perm) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockPermStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockPermStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockPermStore) Find(arg0 context.Context, arg1 string, arg2 int64) (*core.Perm, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Perm) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockPermStoreMockRecorder) Find(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockPermStore)(nil).Find), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockPermStore) List(arg0 context.Context, arg1 string) ([]*core.Collaborator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Collaborator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockPermStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockPermStore)(nil).List), arg0, arg1) -} - -// Update mocks base method. -func (m *MockPermStore) Update(arg0 context.Context, arg1 *core.Perm) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockPermStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockPermStore)(nil).Update), arg0, arg1) -} - -// MockSecretStore is a mock of SecretStore interface. -type MockSecretStore struct { - ctrl *gomock.Controller - recorder *MockSecretStoreMockRecorder -} - -// MockSecretStoreMockRecorder is the mock recorder for MockSecretStore. -type MockSecretStoreMockRecorder struct { - mock *MockSecretStore -} - -// NewMockSecretStore creates a new mock instance. -func NewMockSecretStore(ctrl *gomock.Controller) *MockSecretStore { - mock := &MockSecretStore{ctrl: ctrl} - mock.recorder = &MockSecretStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSecretStore) EXPECT() *MockSecretStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockSecretStore) Create(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockSecretStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockSecretStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockSecretStore) Delete(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockSecretStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSecretStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockSecretStore) Find(arg0 context.Context, arg1 int64) (*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockSecretStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockSecretStore)(nil).Find), arg0, arg1) -} - -// FindName mocks base method. -func (m *MockSecretStore) FindName(arg0 context.Context, arg1 int64, arg2 string) (*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindName", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindName indicates an expected call of FindName. -func (mr *MockSecretStoreMockRecorder) FindName(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindName", reflect.TypeOf((*MockSecretStore)(nil).FindName), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockSecretStore) List(arg0 context.Context, arg1 int64) ([]*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockSecretStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockSecretStore)(nil).List), arg0, arg1) -} - -// Update mocks base method. -func (m *MockSecretStore) Update(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockSecretStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockSecretStore)(nil).Update), arg0, arg1) -} - -// MockGlobalSecretStore is a mock of GlobalSecretStore interface. -type MockGlobalSecretStore struct { - ctrl *gomock.Controller - recorder *MockGlobalSecretStoreMockRecorder -} - -// MockGlobalSecretStoreMockRecorder is the mock recorder for MockGlobalSecretStore. -type MockGlobalSecretStoreMockRecorder struct { - mock *MockGlobalSecretStore -} - -// NewMockGlobalSecretStore creates a new mock instance. -func NewMockGlobalSecretStore(ctrl *gomock.Controller) *MockGlobalSecretStore { - mock := &MockGlobalSecretStore{ctrl: ctrl} - mock.recorder = &MockGlobalSecretStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockGlobalSecretStore) EXPECT() *MockGlobalSecretStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockGlobalSecretStore) Create(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockGlobalSecretStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockGlobalSecretStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockGlobalSecretStore) Delete(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockGlobalSecretStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockGlobalSecretStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockGlobalSecretStore) Find(arg0 context.Context, arg1 int64) (*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockGlobalSecretStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockGlobalSecretStore)(nil).Find), arg0, arg1) -} - -// FindName mocks base method. -func (m *MockGlobalSecretStore) FindName(arg0 context.Context, arg1, arg2 string) (*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindName", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindName indicates an expected call of FindName. -func (mr *MockGlobalSecretStoreMockRecorder) FindName(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindName", reflect.TypeOf((*MockGlobalSecretStore)(nil).FindName), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockGlobalSecretStore) List(arg0 context.Context, arg1 string) ([]*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockGlobalSecretStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockGlobalSecretStore)(nil).List), arg0, arg1) -} - -// ListAll mocks base method. -func (m *MockGlobalSecretStore) ListAll(arg0 context.Context) ([]*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListAll", arg0) - ret0, _ := ret[0].([]*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListAll indicates an expected call of ListAll. -func (mr *MockGlobalSecretStoreMockRecorder) ListAll(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAll", reflect.TypeOf((*MockGlobalSecretStore)(nil).ListAll), arg0) -} - -// Update mocks base method. -func (m *MockGlobalSecretStore) Update(arg0 context.Context, arg1 *core.Secret) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockGlobalSecretStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockGlobalSecretStore)(nil).Update), arg0, arg1) -} - -// MockStageStore is a mock of StageStore interface. -type MockStageStore struct { - ctrl *gomock.Controller - recorder *MockStageStoreMockRecorder -} - -// MockStageStoreMockRecorder is the mock recorder for MockStageStore. -type MockStageStoreMockRecorder struct { - mock *MockStageStore -} - -// NewMockStageStore creates a new mock instance. -func NewMockStageStore(ctrl *gomock.Controller) *MockStageStore { - mock := &MockStageStore{ctrl: ctrl} - mock.recorder = &MockStageStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStageStore) EXPECT() *MockStageStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockStageStore) Create(arg0 context.Context, arg1 *core.Stage) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockStageStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockStageStore)(nil).Create), arg0, arg1) -} - -// Find mocks base method. -func (m *MockStageStore) Find(arg0 context.Context, arg1 int64) (*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockStageStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockStageStore)(nil).Find), arg0, arg1) -} - -// FindNumber mocks base method. -func (m *MockStageStore) FindNumber(arg0 context.Context, arg1 int64, arg2 int) (*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindNumber", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindNumber indicates an expected call of FindNumber. -func (mr *MockStageStoreMockRecorder) FindNumber(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindNumber", reflect.TypeOf((*MockStageStore)(nil).FindNumber), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockStageStore) List(arg0 context.Context, arg1 int64) ([]*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockStageStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockStageStore)(nil).List), arg0, arg1) -} - -// ListIncomplete mocks base method. -func (m *MockStageStore) ListIncomplete(arg0 context.Context) ([]*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListIncomplete", arg0) - ret0, _ := ret[0].([]*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListIncomplete indicates an expected call of ListIncomplete. -func (mr *MockStageStoreMockRecorder) ListIncomplete(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListIncomplete", reflect.TypeOf((*MockStageStore)(nil).ListIncomplete), arg0) -} - -// ListState mocks base method. -func (m *MockStageStore) ListState(arg0 context.Context, arg1 string) ([]*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListState", arg0, arg1) - ret0, _ := ret[0].([]*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListState indicates an expected call of ListState. -func (mr *MockStageStoreMockRecorder) ListState(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListState", reflect.TypeOf((*MockStageStore)(nil).ListState), arg0, arg1) -} - -// ListSteps mocks base method. -func (m *MockStageStore) ListSteps(arg0 context.Context, arg1 int64) ([]*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListSteps", arg0, arg1) - ret0, _ := ret[0].([]*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListSteps indicates an expected call of ListSteps. -func (mr *MockStageStoreMockRecorder) ListSteps(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSteps", reflect.TypeOf((*MockStageStore)(nil).ListSteps), arg0, arg1) -} - -// Update mocks base method. -func (m *MockStageStore) Update(arg0 context.Context, arg1 *core.Stage) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockStageStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStageStore)(nil).Update), arg0, arg1) -} - -// MockStepStore is a mock of StepStore interface. -type MockStepStore struct { - ctrl *gomock.Controller - recorder *MockStepStoreMockRecorder -} - -// MockStepStoreMockRecorder is the mock recorder for MockStepStore. -type MockStepStoreMockRecorder struct { - mock *MockStepStore -} - -// NewMockStepStore creates a new mock instance. -func NewMockStepStore(ctrl *gomock.Controller) *MockStepStore { - mock := &MockStepStore{ctrl: ctrl} - mock.recorder = &MockStepStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStepStore) EXPECT() *MockStepStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockStepStore) Create(arg0 context.Context, arg1 *core.Step) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockStepStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockStepStore)(nil).Create), arg0, arg1) -} - -// Find mocks base method. -func (m *MockStepStore) Find(arg0 context.Context, arg1 int64) (*core.Step, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Step) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockStepStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockStepStore)(nil).Find), arg0, arg1) -} - -// FindNumber mocks base method. -func (m *MockStepStore) FindNumber(arg0 context.Context, arg1 int64, arg2 int) (*core.Step, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindNumber", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Step) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindNumber indicates an expected call of FindNumber. -func (mr *MockStepStoreMockRecorder) FindNumber(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindNumber", reflect.TypeOf((*MockStepStore)(nil).FindNumber), arg0, arg1, arg2) -} - -// List mocks base method. -func (m *MockStepStore) List(arg0 context.Context, arg1 int64) ([]*core.Step, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Step) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockStepStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockStepStore)(nil).List), arg0, arg1) -} - -// Update mocks base method. -func (m *MockStepStore) Update(arg0 context.Context, arg1 *core.Step) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockStepStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStepStore)(nil).Update), arg0, arg1) -} - -// MockRepositoryStore is a mock of RepositoryStore interface. -type MockRepositoryStore struct { - ctrl *gomock.Controller - recorder *MockRepositoryStoreMockRecorder -} - -// MockRepositoryStoreMockRecorder is the mock recorder for MockRepositoryStore. -type MockRepositoryStoreMockRecorder struct { - mock *MockRepositoryStore -} - -// NewMockRepositoryStore creates a new mock instance. -func NewMockRepositoryStore(ctrl *gomock.Controller) *MockRepositoryStore { - mock := &MockRepositoryStore{ctrl: ctrl} - mock.recorder = &MockRepositoryStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockRepositoryStore) EXPECT() *MockRepositoryStoreMockRecorder { - return m.recorder -} - -// Activate mocks base method. -func (m *MockRepositoryStore) Activate(arg0 context.Context, arg1 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Activate", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Activate indicates an expected call of Activate. -func (mr *MockRepositoryStoreMockRecorder) Activate(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Activate", reflect.TypeOf((*MockRepositoryStore)(nil).Activate), arg0, arg1) -} - -// Count mocks base method. -func (m *MockRepositoryStore) Count(arg0 context.Context) (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Count", arg0) - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Count indicates an expected call of Count. -func (mr *MockRepositoryStoreMockRecorder) Count(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockRepositoryStore)(nil).Count), arg0) -} - -// Create mocks base method. -func (m *MockRepositoryStore) Create(arg0 context.Context, arg1 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockRepositoryStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockRepositoryStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockRepositoryStore) Delete(arg0 context.Context, arg1 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockRepositoryStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRepositoryStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockRepositoryStore) Find(arg0 context.Context, arg1 int64) (*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockRepositoryStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockRepositoryStore)(nil).Find), arg0, arg1) -} - -// FindName mocks base method. -func (m *MockRepositoryStore) FindName(arg0 context.Context, arg1, arg2 string) (*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindName", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindName indicates an expected call of FindName. -func (mr *MockRepositoryStoreMockRecorder) FindName(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindName", reflect.TypeOf((*MockRepositoryStore)(nil).FindName), arg0, arg1, arg2) -} - -// Increment mocks base method. -func (m *MockRepositoryStore) Increment(arg0 context.Context, arg1 *core.Repository) (*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Increment", arg0, arg1) - ret0, _ := ret[0].(*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Increment indicates an expected call of Increment. -func (mr *MockRepositoryStoreMockRecorder) Increment(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Increment", reflect.TypeOf((*MockRepositoryStore)(nil).Increment), arg0, arg1) -} - -// List mocks base method. -func (m *MockRepositoryStore) List(arg0 context.Context, arg1 int64) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockRepositoryStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRepositoryStore)(nil).List), arg0, arg1) -} - -// ListAll mocks base method. -func (m *MockRepositoryStore) ListAll(arg0 context.Context, arg1, arg2 int) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListAll", arg0, arg1, arg2) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListAll indicates an expected call of ListAll. -func (mr *MockRepositoryStoreMockRecorder) ListAll(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAll", reflect.TypeOf((*MockRepositoryStore)(nil).ListAll), arg0, arg1, arg2) -} - -// ListIncomplete mocks base method. -func (m *MockRepositoryStore) ListIncomplete(arg0 context.Context) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListIncomplete", arg0) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListIncomplete indicates an expected call of ListIncomplete. -func (mr *MockRepositoryStoreMockRecorder) ListIncomplete(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListIncomplete", reflect.TypeOf((*MockRepositoryStore)(nil).ListIncomplete), arg0) -} - -// ListLatest mocks base method. -func (m *MockRepositoryStore) ListLatest(arg0 context.Context, arg1 int64) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListLatest", arg0, arg1) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListLatest indicates an expected call of ListLatest. -func (mr *MockRepositoryStoreMockRecorder) ListLatest(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListLatest", reflect.TypeOf((*MockRepositoryStore)(nil).ListLatest), arg0, arg1) -} - -// ListRecent mocks base method. -func (m *MockRepositoryStore) ListRecent(arg0 context.Context, arg1 int64) ([]*core.Repository, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListRecent", arg0, arg1) - ret0, _ := ret[0].([]*core.Repository) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListRecent indicates an expected call of ListRecent. -func (mr *MockRepositoryStoreMockRecorder) ListRecent(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRecent", reflect.TypeOf((*MockRepositoryStore)(nil).ListRecent), arg0, arg1) -} - -// Update mocks base method. -func (m *MockRepositoryStore) Update(arg0 context.Context, arg1 *core.Repository) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockRepositoryStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockRepositoryStore)(nil).Update), arg0, arg1) -} - -// MockUserStore is a mock of UserStore interface. -type MockUserStore struct { - ctrl *gomock.Controller - recorder *MockUserStoreMockRecorder -} - -// MockUserStoreMockRecorder is the mock recorder for MockUserStore. -type MockUserStoreMockRecorder struct { - mock *MockUserStore -} - -// NewMockUserStore creates a new mock instance. -func NewMockUserStore(ctrl *gomock.Controller) *MockUserStore { - mock := &MockUserStore{ctrl: ctrl} - mock.recorder = &MockUserStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUserStore) EXPECT() *MockUserStoreMockRecorder { - return m.recorder -} - -// Count mocks base method. -func (m *MockUserStore) Count(arg0 context.Context) (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Count", arg0) - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Count indicates an expected call of Count. -func (mr *MockUserStoreMockRecorder) Count(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockUserStore)(nil).Count), arg0) -} - -// CountHuman mocks base method. -func (m *MockUserStore) CountHuman(arg0 context.Context) (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CountHuman", arg0) - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CountHuman indicates an expected call of CountHuman. -func (mr *MockUserStoreMockRecorder) CountHuman(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CountHuman", reflect.TypeOf((*MockUserStore)(nil).CountHuman), arg0) -} - -// Create mocks base method. -func (m *MockUserStore) Create(arg0 context.Context, arg1 *core.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockUserStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUserStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockUserStore) Delete(arg0 context.Context, arg1 *core.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockUserStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockUserStore) Find(arg0 context.Context, arg1 int64) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockUserStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockUserStore)(nil).Find), arg0, arg1) -} - -// FindLogin mocks base method. -func (m *MockUserStore) FindLogin(arg0 context.Context, arg1 string) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindLogin", arg0, arg1) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindLogin indicates an expected call of FindLogin. -func (mr *MockUserStoreMockRecorder) FindLogin(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindLogin", reflect.TypeOf((*MockUserStore)(nil).FindLogin), arg0, arg1) -} - -// FindToken mocks base method. -func (m *MockUserStore) FindToken(arg0 context.Context, arg1 string) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindToken", arg0, arg1) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindToken indicates an expected call of FindToken. -func (mr *MockUserStoreMockRecorder) FindToken(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindToken", reflect.TypeOf((*MockUserStore)(nil).FindToken), arg0, arg1) -} - -// List mocks base method. -func (m *MockUserStore) List(arg0 context.Context) ([]*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0) - ret0, _ := ret[0].([]*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockUserStoreMockRecorder) List(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockUserStore)(nil).List), arg0) -} - -// ListRange mocks base method. -func (m *MockUserStore) ListRange(arg0 context.Context, arg1 core.UserParams) ([]*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListRange", arg0, arg1) - ret0, _ := ret[0].([]*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListRange indicates an expected call of ListRange. -func (mr *MockUserStoreMockRecorder) ListRange(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRange", reflect.TypeOf((*MockUserStore)(nil).ListRange), arg0, arg1) -} - -// Update mocks base method. -func (m *MockUserStore) Update(arg0 context.Context, arg1 *core.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockUserStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockUserStore)(nil).Update), arg0, arg1) -} - -// MockScheduler is a mock of Scheduler interface. -type MockScheduler struct { - ctrl *gomock.Controller - recorder *MockSchedulerMockRecorder -} - -// MockSchedulerMockRecorder is the mock recorder for MockScheduler. -type MockSchedulerMockRecorder struct { - mock *MockScheduler -} - -// NewMockScheduler creates a new mock instance. -func NewMockScheduler(ctrl *gomock.Controller) *MockScheduler { - mock := &MockScheduler{ctrl: ctrl} - mock.recorder = &MockSchedulerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockScheduler) EXPECT() *MockSchedulerMockRecorder { - return m.recorder -} - -// Cancel mocks base method. -func (m *MockScheduler) Cancel(arg0 context.Context, arg1 int64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Cancel", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Cancel indicates an expected call of Cancel. -func (mr *MockSchedulerMockRecorder) Cancel(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockScheduler)(nil).Cancel), arg0, arg1) -} - -// Cancelled mocks base method. -func (m *MockScheduler) Cancelled(arg0 context.Context, arg1 int64) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Cancelled", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Cancelled indicates an expected call of Cancelled. -func (mr *MockSchedulerMockRecorder) Cancelled(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancelled", reflect.TypeOf((*MockScheduler)(nil).Cancelled), arg0, arg1) -} - -// Pause mocks base method. -func (m *MockScheduler) Pause(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Pause", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Pause indicates an expected call of Pause. -func (mr *MockSchedulerMockRecorder) Pause(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pause", reflect.TypeOf((*MockScheduler)(nil).Pause), arg0) -} - -// Request mocks base method. -func (m *MockScheduler) Request(arg0 context.Context, arg1 core.Filter) (*core.Stage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Request", arg0, arg1) - ret0, _ := ret[0].(*core.Stage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Request indicates an expected call of Request. -func (mr *MockSchedulerMockRecorder) Request(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Request", reflect.TypeOf((*MockScheduler)(nil).Request), arg0, arg1) -} - -// Resume mocks base method. -func (m *MockScheduler) Resume(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Resume", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Resume indicates an expected call of Resume. -func (mr *MockSchedulerMockRecorder) Resume(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resume", reflect.TypeOf((*MockScheduler)(nil).Resume), arg0) -} - -// Schedule mocks base method. -func (m *MockScheduler) Schedule(arg0 context.Context, arg1 *core.Stage) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Schedule", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Schedule indicates an expected call of Schedule. -func (mr *MockSchedulerMockRecorder) Schedule(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Schedule", reflect.TypeOf((*MockScheduler)(nil).Schedule), arg0, arg1) -} - -// Stats mocks base method. -func (m *MockScheduler) Stats(arg0 context.Context) (interface{}, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Stats", arg0) - ret0, _ := ret[0].(interface{}) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Stats indicates an expected call of Stats. -func (mr *MockSchedulerMockRecorder) Stats(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stats", reflect.TypeOf((*MockScheduler)(nil).Stats), arg0) -} - -// MockSession is a mock of Session interface. -type MockSession struct { - ctrl *gomock.Controller - recorder *MockSessionMockRecorder -} - -// MockSessionMockRecorder is the mock recorder for MockSession. -type MockSessionMockRecorder struct { - mock *MockSession -} - -// NewMockSession creates a new mock instance. -func NewMockSession(ctrl *gomock.Controller) *MockSession { - mock := &MockSession{ctrl: ctrl} - mock.recorder = &MockSessionMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSession) EXPECT() *MockSessionMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockSession) Create(arg0 http.ResponseWriter, arg1 *core.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockSessionMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockSession)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockSession) Delete(arg0 http.ResponseWriter) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockSessionMockRecorder) Delete(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSession)(nil).Delete), arg0) -} - -// Get mocks base method. -func (m *MockSession) Get(arg0 *http.Request) (*core.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0) - ret0, _ := ret[0].(*core.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get. -func (mr *MockSessionMockRecorder) Get(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSession)(nil).Get), arg0) -} - -// MockOrganizationService is a mock of OrganizationService interface. -type MockOrganizationService struct { - ctrl *gomock.Controller - recorder *MockOrganizationServiceMockRecorder -} - -// MockOrganizationServiceMockRecorder is the mock recorder for MockOrganizationService. -type MockOrganizationServiceMockRecorder struct { - mock *MockOrganizationService -} - -// NewMockOrganizationService creates a new mock instance. -func NewMockOrganizationService(ctrl *gomock.Controller) *MockOrganizationService { - mock := &MockOrganizationService{ctrl: ctrl} - mock.recorder = &MockOrganizationServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockOrganizationService) EXPECT() *MockOrganizationServiceMockRecorder { - return m.recorder -} - -// List mocks base method. -func (m *MockOrganizationService) List(arg0 context.Context, arg1 *core.User) ([]*core.Organization, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Organization) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockOrganizationServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockOrganizationService)(nil).List), arg0, arg1) -} - -// Membership mocks base method. -func (m *MockOrganizationService) Membership(arg0 context.Context, arg1 *core.User, arg2 string) (bool, bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Membership", arg0, arg1, arg2) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(bool) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// Membership indicates an expected call of Membership. -func (mr *MockOrganizationServiceMockRecorder) Membership(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Membership", reflect.TypeOf((*MockOrganizationService)(nil).Membership), arg0, arg1, arg2) -} - -// MockSecretService is a mock of SecretService interface. -type MockSecretService struct { - ctrl *gomock.Controller - recorder *MockSecretServiceMockRecorder -} - -// MockSecretServiceMockRecorder is the mock recorder for MockSecretService. -type MockSecretServiceMockRecorder struct { - mock *MockSecretService -} - -// NewMockSecretService creates a new mock instance. -func NewMockSecretService(ctrl *gomock.Controller) *MockSecretService { - mock := &MockSecretService{ctrl: ctrl} - mock.recorder = &MockSecretServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSecretService) EXPECT() *MockSecretServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockSecretService) Find(arg0 context.Context, arg1 *core.SecretArgs) (*core.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockSecretServiceMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockSecretService)(nil).Find), arg0, arg1) -} - -// MockRegistryService is a mock of RegistryService interface. -type MockRegistryService struct { - ctrl *gomock.Controller - recorder *MockRegistryServiceMockRecorder -} - -// MockRegistryServiceMockRecorder is the mock recorder for MockRegistryService. -type MockRegistryServiceMockRecorder struct { - mock *MockRegistryService -} - -// NewMockRegistryService creates a new mock instance. -func NewMockRegistryService(ctrl *gomock.Controller) *MockRegistryService { - mock := &MockRegistryService{ctrl: ctrl} - mock.recorder = &MockRegistryServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockRegistryService) EXPECT() *MockRegistryServiceMockRecorder { - return m.recorder -} - -// List mocks base method. -func (m *MockRegistryService) List(arg0 context.Context, arg1 *core.RegistryArgs) ([]*core.Registry, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) - ret0, _ := ret[0].([]*core.Registry) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// List indicates an expected call of List. -func (mr *MockRegistryServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRegistryService)(nil).List), arg0, arg1) -} - -// MockConfigService is a mock of ConfigService interface. -type MockConfigService struct { - ctrl *gomock.Controller - recorder *MockConfigServiceMockRecorder -} - -// MockConfigServiceMockRecorder is the mock recorder for MockConfigService. -type MockConfigServiceMockRecorder struct { - mock *MockConfigService -} - -// NewMockConfigService creates a new mock instance. -func NewMockConfigService(ctrl *gomock.Controller) *MockConfigService { - mock := &MockConfigService{ctrl: ctrl} - mock.recorder = &MockConfigServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockConfigService) EXPECT() *MockConfigServiceMockRecorder { - return m.recorder -} - -// Find mocks base method. -func (m *MockConfigService) Find(arg0 context.Context, arg1 *core.ConfigArgs) (*core.Config, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Config) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockConfigServiceMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockConfigService)(nil).Find), arg0, arg1) -} - -// MockTransferer is a mock of Transferer interface. -type MockTransferer struct { - ctrl *gomock.Controller - recorder *MockTransfererMockRecorder -} - -// MockTransfererMockRecorder is the mock recorder for MockTransferer. -type MockTransfererMockRecorder struct { - mock *MockTransferer -} - -// NewMockTransferer creates a new mock instance. -func NewMockTransferer(ctrl *gomock.Controller) *MockTransferer { - mock := &MockTransferer{ctrl: ctrl} - mock.recorder = &MockTransfererMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockTransferer) EXPECT() *MockTransfererMockRecorder { - return m.recorder -} - -// Transfer mocks base method. -func (m *MockTransferer) Transfer(arg0 context.Context, arg1 *core.User) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Transfer", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Transfer indicates an expected call of Transfer. -func (mr *MockTransfererMockRecorder) Transfer(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transfer", reflect.TypeOf((*MockTransferer)(nil).Transfer), arg0, arg1) -} - -// MockTriggerer is a mock of Triggerer interface. -type MockTriggerer struct { - ctrl *gomock.Controller - recorder *MockTriggererMockRecorder -} - -// MockTriggererMockRecorder is the mock recorder for MockTriggerer. -type MockTriggererMockRecorder struct { - mock *MockTriggerer -} - -// NewMockTriggerer creates a new mock instance. -func NewMockTriggerer(ctrl *gomock.Controller) *MockTriggerer { - mock := &MockTriggerer{ctrl: ctrl} - mock.recorder = &MockTriggererMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockTriggerer) EXPECT() *MockTriggererMockRecorder { - return m.recorder -} - -// Trigger mocks base method. -func (m *MockTriggerer) Trigger(arg0 context.Context, arg1 *core.Repository, arg2 *core.Hook) (*core.Build, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Trigger", arg0, arg1, arg2) - ret0, _ := ret[0].(*core.Build) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Trigger indicates an expected call of Trigger. -func (mr *MockTriggererMockRecorder) Trigger(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trigger", reflect.TypeOf((*MockTriggerer)(nil).Trigger), arg0, arg1, arg2) -} - -// MockSyncer is a mock of Syncer interface. -type MockSyncer struct { - ctrl *gomock.Controller - recorder *MockSyncerMockRecorder -} - -// MockSyncerMockRecorder is the mock recorder for MockSyncer. -type MockSyncerMockRecorder struct { - mock *MockSyncer -} - -// NewMockSyncer creates a new mock instance. -func NewMockSyncer(ctrl *gomock.Controller) *MockSyncer { - mock := &MockSyncer{ctrl: ctrl} - mock.recorder = &MockSyncerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSyncer) EXPECT() *MockSyncerMockRecorder { - return m.recorder -} - -// Sync mocks base method. -func (m *MockSyncer) Sync(arg0 context.Context, arg1 *core.User) (*core.Batch, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Sync", arg0, arg1) - ret0, _ := ret[0].(*core.Batch) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Sync indicates an expected call of Sync. -func (mr *MockSyncerMockRecorder) Sync(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sync", reflect.TypeOf((*MockSyncer)(nil).Sync), arg0, arg1) -} - -// MockLogStream is a mock of LogStream interface. -type MockLogStream struct { - ctrl *gomock.Controller - recorder *MockLogStreamMockRecorder -} - -// MockLogStreamMockRecorder is the mock recorder for MockLogStream. -type MockLogStreamMockRecorder struct { - mock *MockLogStream -} - -// NewMockLogStream creates a new mock instance. -func NewMockLogStream(ctrl *gomock.Controller) *MockLogStream { - mock := &MockLogStream{ctrl: ctrl} - mock.recorder = &MockLogStreamMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockLogStream) EXPECT() *MockLogStreamMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockLogStream) Create(arg0 context.Context, arg1 int64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockLogStreamMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockLogStream)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockLogStream) Delete(arg0 context.Context, arg1 int64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockLogStreamMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockLogStream)(nil).Delete), arg0, arg1) -} - -// Info mocks base method. -func (m *MockLogStream) Info(arg0 context.Context) *core.LogStreamInfo { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Info", arg0) - ret0, _ := ret[0].(*core.LogStreamInfo) - return ret0 -} - -// Info indicates an expected call of Info. -func (mr *MockLogStreamMockRecorder) Info(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogStream)(nil).Info), arg0) -} - -// Tail mocks base method. -func (m *MockLogStream) Tail(arg0 context.Context, arg1 int64) (<-chan *core.Line, <-chan error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Tail", arg0, arg1) - ret0, _ := ret[0].(<-chan *core.Line) - ret1, _ := ret[1].(<-chan error) - return ret0, ret1 -} - -// Tail indicates an expected call of Tail. -func (mr *MockLogStreamMockRecorder) Tail(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tail", reflect.TypeOf((*MockLogStream)(nil).Tail), arg0, arg1) -} - -// Write mocks base method. -func (m *MockLogStream) Write(arg0 context.Context, arg1 int64, arg2 *core.Line) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Write", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// Write indicates an expected call of Write. -func (mr *MockLogStreamMockRecorder) Write(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockLogStream)(nil).Write), arg0, arg1, arg2) -} - -// MockWebhookSender is a mock of WebhookSender interface. -type MockWebhookSender struct { - ctrl *gomock.Controller - recorder *MockWebhookSenderMockRecorder -} - -// MockWebhookSenderMockRecorder is the mock recorder for MockWebhookSender. -type MockWebhookSenderMockRecorder struct { - mock *MockWebhookSender -} - -// NewMockWebhookSender creates a new mock instance. -func NewMockWebhookSender(ctrl *gomock.Controller) *MockWebhookSender { - mock := &MockWebhookSender{ctrl: ctrl} - mock.recorder = &MockWebhookSenderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockWebhookSender) EXPECT() *MockWebhookSenderMockRecorder { - return m.recorder -} - -// Send mocks base method. -func (m *MockWebhookSender) Send(arg0 context.Context, arg1 *core.WebhookData) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Send", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Send indicates an expected call of Send. -func (mr *MockWebhookSenderMockRecorder) Send(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockWebhookSender)(nil).Send), arg0, arg1) -} - -// MockLicenseService is a mock of LicenseService interface. -type MockLicenseService struct { - ctrl *gomock.Controller - recorder *MockLicenseServiceMockRecorder -} - -// MockLicenseServiceMockRecorder is the mock recorder for MockLicenseService. -type MockLicenseServiceMockRecorder struct { - mock *MockLicenseService -} - -// NewMockLicenseService creates a new mock instance. -func NewMockLicenseService(ctrl *gomock.Controller) *MockLicenseService { - mock := &MockLicenseService{ctrl: ctrl} - mock.recorder = &MockLicenseServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockLicenseService) EXPECT() *MockLicenseServiceMockRecorder { - return m.recorder -} - -// Exceeded mocks base method. -func (m *MockLicenseService) Exceeded(arg0 context.Context) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Exceeded", arg0) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Exceeded indicates an expected call of Exceeded. -func (mr *MockLicenseServiceMockRecorder) Exceeded(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exceeded", reflect.TypeOf((*MockLicenseService)(nil).Exceeded), arg0) -} - -// Expired mocks base method. -func (m *MockLicenseService) Expired(arg0 context.Context) bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Expired", arg0) - ret0, _ := ret[0].(bool) - return ret0 -} - -// Expired indicates an expected call of Expired. -func (mr *MockLicenseServiceMockRecorder) Expired(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Expired", reflect.TypeOf((*MockLicenseService)(nil).Expired), arg0) -} - -// MockTemplateStore is a mock of TemplateStore interface. -type MockTemplateStore struct { - ctrl *gomock.Controller - recorder *MockTemplateStoreMockRecorder -} - -// MockTemplateStoreMockRecorder is the mock recorder for MockTemplateStore. -type MockTemplateStoreMockRecorder struct { - mock *MockTemplateStore -} - -// NewMockTemplateStore creates a new mock instance. -func NewMockTemplateStore(ctrl *gomock.Controller) *MockTemplateStore { - mock := &MockTemplateStore{ctrl: ctrl} - mock.recorder = &MockTemplateStoreMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockTemplateStore) EXPECT() *MockTemplateStoreMockRecorder { - return m.recorder -} - -// Create mocks base method. -func (m *MockTemplateStore) Create(arg0 context.Context, arg1 *core.Template) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Create indicates an expected call of Create. -func (mr *MockTemplateStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockTemplateStore)(nil).Create), arg0, arg1) -} - -// Delete mocks base method. -func (m *MockTemplateStore) Delete(arg0 context.Context, arg1 *core.Template) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockTemplateStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTemplateStore)(nil).Delete), arg0, arg1) -} - -// Find mocks base method. -func (m *MockTemplateStore) Find(arg0 context.Context, arg1 int64) (*core.Template, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Find", arg0, arg1) - ret0, _ := ret[0].(*core.Template) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Find indicates an expected call of Find. -func (mr *MockTemplateStoreMockRecorder) Find(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockTemplateStore)(nil).Find), arg0, arg1) -} - -// FindName mocks base method. -func (m *MockTemplateStore) FindName(arg0 context.Context, arg1 string) (*core.Template, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FindName", arg0, arg1) - ret0, _ := ret[0].(*core.Template) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindName indicates an expected call of FindName. -func (mr *MockTemplateStoreMockRecorder) FindName(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindName", reflect.TypeOf((*MockTemplateStore)(nil).FindName), arg0, arg1) -} - -// ListAll mocks base method. -func (m *MockTemplateStore) ListAll(arg0 context.Context) ([]*core.Template, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListAll", arg0) - ret0, _ := ret[0].([]*core.Template) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListAll indicates an expected call of ListAll. -func (mr *MockTemplateStoreMockRecorder) ListAll(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAll", reflect.TypeOf((*MockTemplateStore)(nil).ListAll), arg0) -} - -// Update mocks base method. -func (m *MockTemplateStore) Update(arg0 context.Context, arg1 *core.Template) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Update indicates an expected call of Update. -func (mr *MockTemplateStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockTemplateStore)(nil).Update), arg0, arg1) -} diff --git a/plugin/converter/starlark.go b/plugin/converter/starlark.go index dd44c743..5a1cb852 100644 --- a/plugin/converter/starlark.go +++ b/plugin/converter/starlark.go @@ -17,7 +17,7 @@ package converter import ( "context" "github.com/drone/drone/core" - "github.com/drone/drone/plugin/converter/parser" + "github.com/drone/drone/plugin/converter/starlark" "strings" ) @@ -48,7 +48,7 @@ func (p *starlarkPlugin) Convert(ctx context.Context, req *core.ConvertArgs) (*c return nil, nil } - file, _ := parser.ParseStarlark(req, nil, nil) + file, _ := starlark.Parse(req, nil, nil) return &core.Config{ Data: *file, }, nil diff --git a/plugin/converter/parser/args.go b/plugin/converter/starlark/args.go similarity index 99% rename from plugin/converter/parser/args.go rename to plugin/converter/starlark/args.go index 09b9d796..f31641d1 100644 --- a/plugin/converter/parser/args.go +++ b/plugin/converter/starlark/args.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parser +package starlark import ( "github.com/drone/drone/core" diff --git a/plugin/converter/parser/starlark.go b/plugin/converter/starlark/starlark.go similarity index 79% rename from plugin/converter/parser/starlark.go rename to plugin/converter/starlark/starlark.go index 125f2c03..e3040dfe 100644 --- a/plugin/converter/parser/starlark.go +++ b/plugin/converter/starlark/starlark.go @@ -1,4 +1,18 @@ -package parser +// Copyright 2019 Drone IO, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package starlark import ( "bytes" @@ -38,7 +52,7 @@ var ( ErrCannotLoad = errors.New("starlark: cannot load external scripts") ) -func ParseStarlark(req *core.ConvertArgs, template *core.Template, templateData map[string]interface{}) (file *string, err error) { +func Parse(req *core.ConvertArgs, template *core.Template, templateData map[string]interface{}) (file *string, err error) { thread := &starlark.Thread{ Name: "drone", Load: noLoad, @@ -49,13 +63,13 @@ func ParseStarlark(req *core.ConvertArgs, template *core.Template, templateData }).Traceln(msg) }, } - var starlarkFile []byte + var starlarkFile string var starlarkFileName string if template != nil { starlarkFile = template.Data starlarkFileName = template.Name } else { - starlarkFile = []byte(req.Config.Data) + starlarkFile = req.Config.Data starlarkFileName = req.Repo.Config } diff --git a/plugin/converter/parser/starlark_test.go b/plugin/converter/starlark/starlark_test.go similarity index 69% rename from plugin/converter/parser/starlark_test.go rename to plugin/converter/starlark/starlark_test.go index fddfe428..c949dd7e 100644 --- a/plugin/converter/parser/starlark_test.go +++ b/plugin/converter/starlark/starlark_test.go @@ -1,4 +1,18 @@ -package parser +// Copyright 2019 Drone IO, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package starlark import ( "github.com/drone/drone/core" @@ -31,7 +45,7 @@ func TestParseStarlark(t *testing.T) { } template := &core.Template{ Name: "my_template.star", - Data: before, + Data: string(before), } templateData := map[string]interface{}{ @@ -42,7 +56,7 @@ func TestParseStarlark(t *testing.T) { req.Config.Data = string(before) - parsedFile, err := ParseStarlark(req, template, templateData) + parsedFile, err := Parse(req, template, templateData) if err != nil { t.Error(err) return @@ -80,7 +94,7 @@ func TestParseStarlarkNotTemplateFile(t *testing.T) { req.Repo.Config = "plugin.starlark.star" req.Config.Data = string(before) - parsedFile, err := ParseStarlark(req, nil, nil) + parsedFile, err := Parse(req, nil, nil) if err != nil { t.Error(err) return diff --git a/plugin/converter/parser/write.go b/plugin/converter/starlark/write.go similarity index 99% rename from plugin/converter/parser/write.go rename to plugin/converter/starlark/write.go index afc212ea..5b5f5f04 100644 --- a/plugin/converter/parser/write.go +++ b/plugin/converter/starlark/write.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parser +package starlark import ( "encoding/json" diff --git a/plugin/converter/template.go b/plugin/converter/template.go index 5a238544..7d86afc6 100644 --- a/plugin/converter/template.go +++ b/plugin/converter/template.go @@ -1,15 +1,31 @@ +// Copyright 2019 Drone IO, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package converter import ( "context" "errors" + "github.com/drone/drone/core" - "github.com/drone/drone/plugin/converter/parser" + "github.com/drone/drone/plugin/converter/starlark" - "gopkg.in/yaml.v2" "regexp" "strings" + + "gopkg.in/yaml.v2" ) var ( @@ -45,7 +61,7 @@ func (p *templatePlugin) Convert(ctx context.Context, req *core.ConvertArgs) (*c return nil, ErrTemplateSyntaxErrors } // get template from db - template, err := p.templateStore.FindName(ctx, templateArgs.Load) + template, err := p.templateStore.FindName(ctx, templateArgs.Load, req.Repo.Namespace) if err != nil { return nil, nil } @@ -57,7 +73,7 @@ func (p *templatePlugin) Convert(ctx context.Context, req *core.ConvertArgs) (*c strings.HasSuffix(templateArgs.Load, ".star") || strings.HasSuffix(templateArgs.Load, ".starlark") { - file, err := parser.ParseStarlark(req, template, templateArgs.Data) + file, err := starlark.Parse(req, template, templateArgs.Data) if err != nil { return nil, err } diff --git a/plugin/converter/template_test.go b/plugin/converter/template_test.go index 0a0bf2c7..3615e351 100644 --- a/plugin/converter/template_test.go +++ b/plugin/converter/template_test.go @@ -1,3 +1,17 @@ +// Copyright 2019 Drone IO, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package converter import ( @@ -9,6 +23,26 @@ import ( ) func TestTemplatePluginConvert(t *testing.T) { + templateArgs, err := ioutil.ReadFile("testdata/starlark.template.yml") + if err != nil { + t.Error(err) + return + } + + req := &core.ConvertArgs{ + Build: &core.Build{ + After: "3d21ec53a331a6f037a91c368710b99387d012c1", + }, + Repo: &core.Repository{ + Slug: "octocat/hello-world", + Config: ".drone.yml", + Namespace: "octocat", + }, + Config: &core.Config{ + Data: string(templateArgs), + }, + } + beforeInput, err := ioutil.ReadFile("testdata/starlark.input.star") if err != nil { t.Error(err) @@ -21,37 +55,18 @@ func TestTemplatePluginConvert(t *testing.T) { return } - templateArgs, err := ioutil.ReadFile("testdata/starlark.template.yml") - if err != nil { - t.Error(err) - return - } - template := &core.Template{ Name: "plugin.starlark", - Data: beforeInput, + Data: string(beforeInput), } controller := gomock.NewController(t) defer controller.Finish() templates := mock.NewMockTemplateStore(controller) - templates.EXPECT().FindName(gomock.Any(), template.Name).Return(template, nil) + templates.EXPECT().FindName(gomock.Any(), template.Name, req.Repo.Namespace).Return(template, nil) plugin := Template(templates) - req := &core.ConvertArgs{ - Build: &core.Build{ - After: "3d21ec53a331a6f037a91c368710b99387d012c1", - }, - Repo: &core.Repository{ - Slug: "octocat/hello-world", - Config: ".drone.yml", - }, - Config: &core.Config{ - Data: string(templateArgs), - }, - } - config, err := plugin.Convert(noContext, req) if err != nil { t.Error(err) @@ -121,35 +136,37 @@ func TestTemplatePluginConvertDroneFileTypePipeline(t *testing.T) { } func TestTemplatePluginConvertTemplateNotFound(t *testing.T) { - controller := gomock.NewController(t) - defer controller.Finish() - - template := &core.Template{ - Name: "plugin.starlark", - Data: nil, - } - - templates := mock.NewMockTemplateStore(controller) - templates.EXPECT().FindName(gomock.Any(), template.Name).Return(nil, nil) - templateArgs, err := ioutil.ReadFile("testdata/starlark.template.yml") if err != nil { t.Error(err) return } - plugin := Template(templates) req := &core.ConvertArgs{ Build: &core.Build{ After: "3d21ec53a331a6f037a91c368710b99387d012c1", }, Repo: &core.Repository{ - Slug: "octocat/hello-world", - Config: ".drone.yml", + Slug: "octocat/hello-world", + Config: ".drone.yml", + Namespace: "octocat", }, Config: &core.Config{Data: string(templateArgs)}, } + controller := gomock.NewController(t) + defer controller.Finish() + + template := &core.Template{ + Name: "plugin.starlark", + Data: "", + } + + templates := mock.NewMockTemplateStore(controller) + templates.EXPECT().FindName(gomock.Any(), template.Name, req.Repo.Namespace).Return(nil, nil) + + plugin := Template(templates) + config, err := plugin.Convert(noContext, req) if config != nil { t.Errorf("template converter: template name given not found") diff --git a/plugin/converter/testdata/input.jsonnet b/plugin/converter/testdata/input.jsonnet new file mode 100644 index 00000000..0fd935a6 --- /dev/null +++ b/plugin/converter/testdata/input.jsonnet @@ -0,0 +1,18 @@ +local stepName = std.extVar("input.my_step"); +local image = std.extVar("input.my_image"); +local commands = std.extVar("input.my_command"); + +{ + "kind": "pipeline", + "type": "docker", + "name": "default", + "steps": [ + { + "name": stepName, + "image": image, + "commands": [ + commands + ] + } + ] +} diff --git a/plugin/converter/testdata/jsonnet.template.yml b/plugin/converter/testdata/jsonnet.template.yml new file mode 100644 index 00000000..2014ec70 --- /dev/null +++ b/plugin/converter/testdata/jsonnet.template.yml @@ -0,0 +1,6 @@ +kind: template +load: plugin.jsonnet +data: + stepName: my_step + image: my_image + commands: my_command \ No newline at end of file diff --git a/store/shared/migrate/mysql/ddl_gen.go b/store/shared/migrate/mysql/ddl_gen.go index 2aee30d1..0e1de487 100644 --- a/store/shared/migrate/mysql/ddl_gen.go +++ b/store/shared/migrate/mysql/ddl_gen.go @@ -664,13 +664,14 @@ CREATE INDEX ix_latest_repo ON latest (latest_repo_id); ` // -// 015_create_table_template.sql +// 015_create_table_templates.sql // var createTableTemplate = ` -CREATE TABLE IF NOT EXISTS template ( +CREATE TABLE IF NOT EXISTS templates ( template_id INTEGER PRIMARY KEY AUTO_INCREMENT ,template_name VARCHAR(500) + ,template_namespace VARCHAR(50) ,template_data BLOB ,template_created INTEGER ,template_updated INTEGER diff --git a/store/shared/migrate/mysql/files/015_create_table_template.sql b/store/shared/migrate/mysql/files/015_create_table_templates.sql similarity index 76% rename from store/shared/migrate/mysql/files/015_create_table_template.sql rename to store/shared/migrate/mysql/files/015_create_table_templates.sql index 2ea58459..5f5caf45 100644 --- a/store/shared/migrate/mysql/files/015_create_table_template.sql +++ b/store/shared/migrate/mysql/files/015_create_table_templates.sql @@ -1,8 +1,9 @@ -- name: create-table-template -CREATE TABLE IF NOT EXISTS template ( +CREATE TABLE IF NOT EXISTS templates ( template_id INTEGER PRIMARY KEY AUTO_INCREMENT ,template_name VARCHAR(500) + ,template_namespace VARCHAR(50) ,template_data BLOB ,template_created INTEGER ,template_updated INTEGER diff --git a/store/shared/migrate/postgres/ddl_gen.go b/store/shared/migrate/postgres/ddl_gen.go index 59d9e3fc..a34aa028 100644 --- a/store/shared/migrate/postgres/ddl_gen.go +++ b/store/shared/migrate/postgres/ddl_gen.go @@ -642,13 +642,14 @@ CREATE INDEX IF NOT EXISTS ix_latest_repo ON latest (latest_repo_id); ` // -// 016_create_template_table.sql +// 016_create_template_tables.sql // var createTableTemplate = ` -CREATE TABLE IF NOT EXISTS template ( +CREATE TABLE IF NOT EXISTS templates ( template_id SERIAL PRIMARY KEY ,template_name TEXT UNIQUE + ,template_namespace VARCHAR(50) ,template_data BYTEA ,template_created INTEGER ,template_updated INTEGER diff --git a/store/shared/migrate/postgres/files/016_create_template_table.sql b/store/shared/migrate/postgres/files/016_create_template_tables.sql similarity index 72% rename from store/shared/migrate/postgres/files/016_create_template_table.sql rename to store/shared/migrate/postgres/files/016_create_template_tables.sql index 840668a3..3cfbcc2e 100644 --- a/store/shared/migrate/postgres/files/016_create_template_table.sql +++ b/store/shared/migrate/postgres/files/016_create_template_tables.sql @@ -1,8 +1,9 @@ -- name: create-table-template -CREATE TABLE IF NOT EXISTS template ( +CREATE TABLE IF NOT EXISTS templates ( template_id SERIAL PRIMARY KEY ,template_name TEXT UNIQUE + ,template_namespace VARCHAR(50) ,template_data BYTEA ,template_created INTEGER ,template_updated INTEGER diff --git a/store/shared/migrate/sqlite/ddl_gen.go b/store/shared/migrate/sqlite/ddl_gen.go index ab5ba6b5..c270e5b1 100644 --- a/store/shared/migrate/sqlite/ddl_gen.go +++ b/store/shared/migrate/sqlite/ddl_gen.go @@ -644,13 +644,14 @@ CREATE INDEX IF NOT EXISTS ix_latest_repo ON latest (latest_repo_id); ` // -// 015_create_template_table.sql +// 015_create_template_tables.sql // var createTableTemplate = ` -CREATE TABLE IF NOT EXISTS template ( - template_id INTEGER PRIMARY KEY AUTOINCREMENT +CREATE TABLE IF NOT EXISTS templates ( + template_id INTEGER PRIMARY KEY AUTOINCREMENT ,template_name TEXT UNIQUE + ,template_namespace TEXT COLLATE NOCASE ,template_data BLOB ,template_created INTEGER ,template_updated INTEGER diff --git a/store/shared/migrate/sqlite/files/015_create_template_table.sql b/store/shared/migrate/sqlite/files/015_create_template_tables.sql similarity index 71% rename from store/shared/migrate/sqlite/files/015_create_template_table.sql rename to store/shared/migrate/sqlite/files/015_create_template_tables.sql index 85262dcf..d5552ba7 100644 --- a/store/shared/migrate/sqlite/files/015_create_template_table.sql +++ b/store/shared/migrate/sqlite/files/015_create_template_tables.sql @@ -1,8 +1,9 @@ -- name: create-table-template -CREATE TABLE IF NOT EXISTS template ( +CREATE TABLE IF NOT EXISTS templates ( template_id INTEGER PRIMARY KEY AUTOINCREMENT ,template_name TEXT UNIQUE + ,template_namespace TEXT COLLATE NOCASE ,template_data BLOB ,template_created INTEGER ,template_updated INTEGER diff --git a/store/template/scan.go b/store/template/scan.go index 76a3f559..e06ebbba 100644 --- a/store/template/scan.go +++ b/store/template/scan.go @@ -8,6 +8,7 @@ package template import ( "database/sql" + "github.com/drone/drone/core" "github.com/drone/drone/store/shared/db" ) @@ -16,11 +17,12 @@ import ( // of named query parameters. func toParams(template *core.Template) (map[string]interface{}, error) { return map[string]interface{}{ - "template_id": template.Id, - "template_name": template.Name, - "template_data": template.Data, - "template_created": template.Created, - "template_updated": template.Updated, + "template_id": template.Id, + "template_name": template.Name, + "template_namespace": template.Namespace, + "template_data": template.Data, + "template_created": template.Created, + "template_updated": template.Updated, }, nil } @@ -30,6 +32,7 @@ func scanRow(scanner db.Scanner, dst *core.Template) error { err := scanner.Scan( &dst.Id, &dst.Name, + &dst.Namespace, &dst.Data, &dst.Created, &dst.Updated, diff --git a/store/template/template.go b/store/template/template.go index 969314de..6585de57 100644 --- a/store/template/template.go +++ b/store/template/template.go @@ -23,6 +23,24 @@ type templateStore struct { db *db.DB } +func (s *templateStore) List(ctx context.Context, namespace string) ([]*core.Template, error) { + var out []*core.Template + err := s.db.View(func(queryer db.Queryer, binder db.Binder) error { + params := map[string]interface{}{"template_namespace": namespace} + stmt, args, err := binder.BindNamed(queryNamespace, params) + if err != nil { + return err + } + rows, err := queryer.Query(stmt, args...) + if err != nil { + return err + } + out, err = scanRows(rows) + return err + }) + return out, err +} + func (s *templateStore) ListAll(ctx context.Context) ([]*core.Template, error) { var out []*core.Template err := s.db.View(func(queryer db.Queryer, binder db.Binder) error { @@ -58,14 +76,16 @@ func (s *templateStore) Find(ctx context.Context, id int64) (*core.Template, err return out, err } -func (s *templateStore) FindName(ctx context.Context, name string) (*core.Template, error) { - out := &core.Template{Name: name} +func (s *templateStore) FindName(ctx context.Context, name string, namespace string) (*core.Template, error) { + out := &core.Template{Name: name, Namespace: namespace} err := s.db.View(func(queryer db.Queryer, binder db.Binder) error { params, err := toParams(out) if err != nil { return err } + query, args, err := binder.BindNamed(queryName, params) + if err != nil { return err } @@ -146,7 +166,7 @@ func (s *templateStore) Delete(ctx context.Context, template *core.Template) err } const queryKey = queryBase + ` -FROM template +FROM templates WHERE template_id = :template_id LIMIT 1 ` @@ -155,24 +175,33 @@ const queryBase = ` SELECT template_id ,template_name +,template_namespace ,template_data ,template_created ,template_updated ` const queryAll = queryBase + ` -FROM template +FROM templates +ORDER BY template_name +` + +const queryNamespace = queryBase + ` +FROM templates +WHERE template_namespace = :template_namespace ORDER BY template_name ` const stmtInsert = ` -INSERT INTO template ( +INSERT INTO templates ( template_name +,template_namespace ,template_data ,template_created ,template_updated ) VALUES ( :template_name +,:template_namespace ,:template_data ,:template_created ,:template_updated @@ -180,20 +209,22 @@ INSERT INTO template ( ` const stmtUpdate = ` -UPDATE template SET +UPDATE templates SET template_name = :template_name +,template_namespace = :template_namespace ,template_data = :template_data ,template_updated = :template_updated WHERE template_id = :template_id ` const stmtDelete = ` -DELETE FROM template +DELETE FROM templates WHERE template_id = :template_id ` const queryName = queryBase + ` -FROM template +FROM templates WHERE template_name = :template_name +AND template_namespace = :template_namespace LIMIT 1 ` diff --git a/store/template/template_test.go b/store/template/template_test.go index 790571e8..c293239e 100644 --- a/store/template/template_test.go +++ b/store/template/template_test.go @@ -7,7 +7,6 @@ package template import ( - "bytes" "context" "database/sql" "github.com/drone/drone/core" @@ -35,11 +34,12 @@ func TestTemplate(t *testing.T) { func testTemplateCreate(store *templateStore) func(t *testing.T) { return func(t *testing.T) { item := &core.Template{ - Id: 1, - Name: "my_template", - Data: []byte("some_template_data"), - Created: 1, - Updated: 2, + Id: 1, + Name: "my_template", + Namespace: "my_org", + Data: "some_template_data", + Created: 1, + Updated: 2, } err := store.Create(noContext, item) if err != nil { @@ -52,6 +52,7 @@ func testTemplateCreate(store *templateStore) func(t *testing.T) { t.Run("Find", testTemplateFind(store, item)) t.Run("FindName", testTemplateFindName(store)) t.Run("ListAll", testTemplateListAll(store)) + t.Run("List", testTemplateList(store)) t.Run("Update", testTemplateUpdate(store)) t.Run("Delete", testTemplateDelete(store)) } @@ -70,7 +71,7 @@ func testTemplateFind(store *templateStore, template *core.Template) func(t *tes func testTemplateFindName(store *templateStore) func(t *testing.T) { return func(t *testing.T) { - item, err := store.FindName(noContext, "my_template") + item, err := store.FindName(noContext, "my_template", "my_org") if err != nil { t.Error(err) } else { @@ -84,9 +85,12 @@ func testTemplate(item *core.Template) func(t *testing.T) { if got, want := item.Name, "my_template"; got != want { t.Errorf("Want template name %q, got %q", want, got) } - if got, want := item.Data, []byte("some_template_data"); bytes.Compare(got, want) != 0 { + if got, want := item.Data, "some_template_data"; got != want { t.Errorf("Want template data %q, got %q", want, got) } + if got, want := item.Namespace, "my_org"; got != want { + t.Errorf("Want template org %q, got %q", want, got) + } } } @@ -105,9 +109,24 @@ func testTemplateListAll(store *templateStore) func(t *testing.T) { } } +func testTemplateList(store *templateStore) func(t *testing.T) { + return func(t *testing.T) { + list, err := store.List(noContext, "my_org") + if err != nil { + t.Error(err) + return + } + if got, want := len(list), 1; got != want { + t.Errorf("Want count %d, got %d", want, got) + } else { + t.Run("Fields", testTemplate(list[0])) + } + } +} + func testTemplateUpdate(store *templateStore) func(t *testing.T) { return func(t *testing.T) { - before, err := store.FindName(noContext, "my_template") + before, err := store.FindName(noContext, "my_template", "my_org") if err != nil { t.Error(err) return @@ -130,7 +149,7 @@ func testTemplateUpdate(store *templateStore) func(t *testing.T) { func testTemplateDelete(store *templateStore) func(t *testing.T) { return func(t *testing.T) { - secret, err := store.FindName(noContext, "my_template") + secret, err := store.FindName(noContext, "my_template", "my_org") if err != nil { t.Error(err) return