2014-06-06 23:40:48 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
|
|
|
|
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 registry
|
|
|
|
|
|
|
|
import (
|
2014-06-12 20:17:34 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
2014-06-06 23:40:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MockServiceRegistry struct {
|
2014-06-12 20:17:34 +00:00
|
|
|
list api.ServiceList
|
2014-06-06 23:40:48 +00:00
|
|
|
err error
|
2014-06-12 20:17:34 +00:00
|
|
|
endpoints api.Endpoints
|
2014-06-06 23:40:48 +00:00
|
|
|
}
|
|
|
|
|
2014-06-12 20:17:34 +00:00
|
|
|
func (m *MockServiceRegistry) ListServices() (api.ServiceList, error) {
|
2014-06-06 23:40:48 +00:00
|
|
|
return m.list, m.err
|
|
|
|
}
|
|
|
|
|
2014-06-12 20:17:34 +00:00
|
|
|
func (m *MockServiceRegistry) CreateService(svc api.Service) error {
|
2014-06-06 23:40:48 +00:00
|
|
|
return m.err
|
|
|
|
}
|
|
|
|
|
2014-06-12 20:17:34 +00:00
|
|
|
func (m *MockServiceRegistry) GetService(name string) (*api.Service, error) {
|
2014-06-06 23:40:48 +00:00
|
|
|
return nil, m.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockServiceRegistry) DeleteService(name string) error {
|
|
|
|
return m.err
|
|
|
|
}
|
|
|
|
|
2014-06-12 20:17:34 +00:00
|
|
|
func (m *MockServiceRegistry) UpdateService(svc api.Service) error {
|
2014-06-06 23:40:48 +00:00
|
|
|
return m.err
|
|
|
|
}
|
|
|
|
|
2014-06-12 20:17:34 +00:00
|
|
|
func (m *MockServiceRegistry) UpdateEndpoints(e api.Endpoints) error {
|
2014-06-06 23:40:48 +00:00
|
|
|
m.endpoints = e
|
|
|
|
return m.err
|
|
|
|
}
|