test

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

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

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) KeysAPI

func (m *MockContext) KeysAPI() (client.KeysAPI, error)

func (*MockContext) Members

func (m *MockContext) Members() ([]string, types.URLsMap, 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)

type MockMembersAPI

type MockMembersAPI struct {
	// contains filtered or unexported fields
}

func (*MockMembersAPI) Add

func (m *MockMembersAPI) Add(ctx ctx.Context, peerURL string) (*client.Member, error)

func (*MockMembersAPI) Leader

func (m *MockMembersAPI) Leader(ctx ctx.Context) (*client.Member, error)

func (*MockMembersAPI) List

func (m *MockMembersAPI) List(ctx ctx.Context) ([]client.Member, error)

func (*MockMembersAPI) Remove

func (m *MockMembersAPI) Remove(ctx ctx.Context, mID string) error

func (*MockMembersAPI) Update

func (m *MockMembersAPI) Update(ctx ctx.Context, mID string, peerURLs []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL