use go:generate to automatically run mockgen on build

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-04-27 11:00:08 +02:00
parent 4138dcfb5a
commit 096c800c1b
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
3 changed files with 95 additions and 94 deletions

View File

@ -90,7 +90,6 @@ func (o upOptions) LoadBalancerArn() *string {
}
func ConvertCommand(clusteropts *clusterOptions, projectOpts *compose.ProjectOptions) *cobra.Command {
opts := upOptions{}
cmd := &cobra.Command{
Use: "convert",
RunE: compose.WithProject(projectOpts, func(project *compose.Project, args []string) error {

View File

@ -1,5 +1,7 @@
package amazon
//go:generate mockgen -destination=./mock/api.go -package=mock . API
type API interface {
downAPI
upAPI

View File

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ./pkg/amazon/api.go
// Source: github.com/docker/ecs-plugin/pkg/amazon (interfaces: API)
// Package mock is a generated GoMock package.
package mock
@ -34,47 +34,89 @@ func (m *MockAPI) EXPECT() *MockAPIMockRecorder {
}
// ClusterExists mocks base method
func (m *MockAPI) ClusterExists(name string) (bool, error) {
func (m *MockAPI) ClusterExists(arg0 string) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClusterExists", name)
ret := m.ctrl.Call(m, "ClusterExists", arg0)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ClusterExists indicates an expected call of ClusterExists
func (mr *MockAPIMockRecorder) ClusterExists(name interface{}) *gomock.Call {
func (mr *MockAPIMockRecorder) ClusterExists(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterExists", reflect.TypeOf((*MockAPI)(nil).ClusterExists), name)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterExists", reflect.TypeOf((*MockAPI)(nil).ClusterExists), arg0)
}
// CreateCluster mocks base method
func (m *MockAPI) CreateCluster(name string) (string, error) {
func (m *MockAPI) CreateCluster(arg0 string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateCluster", name)
ret := m.ctrl.Call(m, "CreateCluster", arg0)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateCluster indicates an expected call of CreateCluster
func (mr *MockAPIMockRecorder) CreateCluster(name interface{}) *gomock.Call {
func (mr *MockAPIMockRecorder) CreateCluster(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCluster", reflect.TypeOf((*MockAPI)(nil).CreateCluster), name)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCluster", reflect.TypeOf((*MockAPI)(nil).CreateCluster), arg0)
}
// CreateStack mocks base method
func (m *MockAPI) CreateStack(arg0 string, arg1 *cloudformation.Template) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateStack", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CreateStack indicates an expected call of CreateStack
func (mr *MockAPIMockRecorder) CreateStack(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStack", reflect.TypeOf((*MockAPI)(nil).CreateStack), arg0, arg1)
}
// DeleteCluster mocks base method
func (m *MockAPI) DeleteCluster(name string) error {
func (m *MockAPI) DeleteCluster(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteCluster", name)
ret := m.ctrl.Call(m, "DeleteCluster", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteCluster indicates an expected call of DeleteCluster
func (mr *MockAPIMockRecorder) DeleteCluster(name interface{}) *gomock.Call {
func (mr *MockAPIMockRecorder) DeleteCluster(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCluster", reflect.TypeOf((*MockAPI)(nil).DeleteCluster), name)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCluster", reflect.TypeOf((*MockAPI)(nil).DeleteCluster), arg0)
}
// DeleteStack mocks base method
func (m *MockAPI) DeleteStack(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteStack", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteStack indicates an expected call of DeleteStack
func (mr *MockAPIMockRecorder) DeleteStack(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteStack", reflect.TypeOf((*MockAPI)(nil).DeleteStack), arg0)
}
// DescribeStackEvents mocks base method
func (m *MockAPI) DescribeStackEvents(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DescribeStackEvents", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// DescribeStackEvents indicates an expected call of DescribeStackEvents
func (mr *MockAPIMockRecorder) DescribeStackEvents(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeStackEvents", reflect.TypeOf((*MockAPI)(nil).DescribeStackEvents), arg0)
}
// GetDefaultVPC mocks base method
@ -92,104 +134,62 @@ func (mr *MockAPIMockRecorder) GetDefaultVPC() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultVPC", reflect.TypeOf((*MockAPI)(nil).GetDefaultVPC))
}
// GetSubNets mocks base method
func (m *MockAPI) GetSubNets(vpcId string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSubNets", vpcId)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSubNets indicates an expected call of GetSubNets
func (mr *MockAPIMockRecorder) GetSubNets(vpcId interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubNets", reflect.TypeOf((*MockAPI)(nil).GetSubNets), vpcId)
}
// ListRolesForPolicy mocks base method
func (m *MockAPI) ListRolesForPolicy(policy string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListRolesForPolicy", policy)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListRolesForPolicy indicates an expected call of ListRolesForPolicy
func (mr *MockAPIMockRecorder) ListRolesForPolicy(policy interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRolesForPolicy", reflect.TypeOf((*MockAPI)(nil).ListRolesForPolicy), policy)
}
// GetRoleArn mocks base method
func (m *MockAPI) GetRoleArn(name string) (string, error) {
func (m *MockAPI) GetRoleArn(arg0 string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetRoleArn", name)
ret := m.ctrl.Call(m, "GetRoleArn", arg0)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetRoleArn indicates an expected call of GetRoleArn
func (mr *MockAPIMockRecorder) GetRoleArn(name interface{}) *gomock.Call {
func (mr *MockAPIMockRecorder) GetRoleArn(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRoleArn", reflect.TypeOf((*MockAPI)(nil).GetRoleArn), name)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRoleArn", reflect.TypeOf((*MockAPI)(nil).GetRoleArn), arg0)
}
// GetSubNets mocks base method
func (m *MockAPI) GetSubNets(arg0 string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSubNets", arg0)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSubNets indicates an expected call of GetSubNets
func (mr *MockAPIMockRecorder) GetSubNets(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubNets", reflect.TypeOf((*MockAPI)(nil).GetSubNets), arg0)
}
// ListRolesForPolicy mocks base method
func (m *MockAPI) ListRolesForPolicy(arg0 string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListRolesForPolicy", arg0)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListRolesForPolicy indicates an expected call of ListRolesForPolicy
func (mr *MockAPIMockRecorder) ListRolesForPolicy(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRolesForPolicy", reflect.TypeOf((*MockAPI)(nil).ListRolesForPolicy), arg0)
}
// StackExists mocks base method
func (m *MockAPI) StackExists(name string) (bool, error) {
func (m *MockAPI) StackExists(arg0 string) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StackExists", name)
ret := m.ctrl.Call(m, "StackExists", arg0)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StackExists indicates an expected call of StackExists
func (mr *MockAPIMockRecorder) StackExists(name interface{}) *gomock.Call {
func (mr *MockAPIMockRecorder) StackExists(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StackExists", reflect.TypeOf((*MockAPI)(nil).StackExists), name)
}
// CreateStack mocks base method
func (m *MockAPI) CreateStack(name string, template *cloudformation.Template) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateStack", name, template)
ret0, _ := ret[0].(error)
return ret0
}
// CreateStack indicates an expected call of CreateStack
func (mr *MockAPIMockRecorder) CreateStack(name, template interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateStack", reflect.TypeOf((*MockAPI)(nil).CreateStack), name, template)
}
// DescribeStackEvents mocks base method
func (m *MockAPI) DescribeStackEvents(stack string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DescribeStackEvents", stack)
ret0, _ := ret[0].(error)
return ret0
}
// DescribeStackEvents indicates an expected call of DescribeStackEvents
func (mr *MockAPIMockRecorder) DescribeStackEvents(stack interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeStackEvents", reflect.TypeOf((*MockAPI)(nil).DescribeStackEvents), stack)
}
// DeleteStack mocks base method
func (m *MockAPI) DeleteStack(name string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteStack", name)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteStack indicates an expected call of DeleteStack
func (mr *MockAPIMockRecorder) DeleteStack(name interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteStack", reflect.TypeOf((*MockAPI)(nil).DeleteStack), name)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StackExists", reflect.TypeOf((*MockAPI)(nil).StackExists), arg0)
}