Documentation ¶
Overview ¶
Copyright 2016 The Rook Authors. 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.
Index ¶
- type MockContext
- func (m *MockContext) AddMembers(members []string)
- func (m *MockContext) Client(initialNodes []string) (client.Client, error)
- func (m *MockContext) KeysAPI() (client.KeysAPI, error)
- func (m *MockContext) Members() ([]string, types.URLsMap, error)
- func (m *MockContext) MembersAPI() (client.MembersAPI, error)
- type MockEmbeddedEtcdFactory
- type MockMembersAPI
- func (m *MockMembersAPI) Add(ctx ctx.Context, peerURL string) (*client.Member, error)
- func (m *MockMembersAPI) Leader(ctx ctx.Context) (*client.Member, error)
- func (m *MockMembersAPI) List(ctx ctx.Context) ([]client.Member, error)
- func (m *MockMembersAPI) Remove(ctx ctx.Context, mID string) error
- func (m *MockMembersAPI) Update(ctx ctx.Context, mID string, peerURLs []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockContext ¶
type MockContext struct {
// contains filtered or unexported fields
}
func (*MockContext) AddMembers ¶
func (m *MockContext) AddMembers(members []string)
AddMembers is added for easier unit testing. In real implementation, we always get the latest membership from the cluster itself.
func (*MockContext) Client ¶
func (m *MockContext) Client(initialNodes []string) (client.Client, error)
func (*MockContext) MembersAPI ¶
func (m *MockContext) MembersAPI() (client.MembersAPI, error)
MembersAPI returns an instance of MembersAPI for the current etcd cluster
type MockEmbeddedEtcdFactory ¶
type MockEmbeddedEtcdFactory struct { }
func (*MockEmbeddedEtcdFactory) NewEmbeddedEtcd ¶
func (m *MockEmbeddedEtcdFactory) NewEmbeddedEtcd(token string, conf *bootstrap.Config, newCluster bool) (*bootstrap.EmbeddedEtcd, error)