Skip to content

Commit

Permalink
regenerate mock
Browse files Browse the repository at this point in the history
Signed-off-by: zychen5186 <[email protected]>
  • Loading branch information
zychen5186 committed Jun 1, 2024
1 parent 16348c8 commit 7be89e1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flyteadmin/pkg/manager/mocks/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
)

type GetDomainsFunc func(ctx context.Context, request admin.GetDomainRequest) *admin.Domains
type CreateProjectFunc func(ctx context.Context, request admin.ProjectRegisterRequest) (*admin.ProjectRegisterResponse, error)
type ListProjectFunc func(ctx context.Context, request admin.ProjectListRequest) (*admin.Projects, error)
type UpdateProjectFunc func(ctx context.Context, request admin.Project) (*admin.ProjectUpdateResponse, error)
type GetProjectFunc func(ctx context.Context, request admin.ProjectGetRequest) (*admin.Project, error)

type MockProjectManager struct {
getDomainsFunc GetDomainsFunc
listProjectFunc ListProjectFunc
createProjectFunc CreateProjectFunc
updateProjectFunc UpdateProjectFunc
Expand All @@ -22,6 +24,13 @@ func (m *MockProjectManager) SetCreateProject(createProjectFunc CreateProjectFun
m.createProjectFunc = createProjectFunc
}

func (manager *MockProjectManager) GetDomains(ctx context.Context, request admin.GetDomainRequest) *admin.Domains {
if manager.getDomainsFunc != nil {
return manager.getDomainsFunc(ctx, request)
}
return nil
}

func (m *MockProjectManager) CreateProject(ctx context.Context, request admin.ProjectRegisterRequest) (*admin.ProjectRegisterResponse, error) {
if m.createProjectFunc != nil {
return m.createProjectFunc(ctx, request)
Expand Down
41 changes: 41 additions & 0 deletions flytectl/pkg/ext/mocks/admin_fetcher_ext_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7be89e1

Please sign in to comment.