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.
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.
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
- type MockConnection
- func (m *MockConnection) Connect() error
- func (m *MockConnection) MonCommand(args []byte) (buffer []byte, info string, err error)
- func (m *MockConnection) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error)
- func (m *MockConnection) OpenIOContext(pool string) (client.IOContext, error)
- func (m *MockConnection) PingMonitor(id string) (string, error)
- func (m *MockConnection) ReadConfigFile(path string) error
- func (m *MockConnection) Shutdown()
- type MockConnectionFactory
- type MockIOContext
- func (m *MockIOContext) CreateImage(name string, size uint64, order int, args ...uint64) (image client.Image, err error)
- func (m *MockIOContext) GetImage(name string) client.Image
- func (m *MockIOContext) GetImageNames() (names []string, err error)
- func (m *MockIOContext) Pointer() uintptr
- func (m *MockIOContext) Read(oid string, data []byte, offset uint64) (int, error)
- func (m *MockIOContext) Write(oid string, data []byte, offset uint64) error
- func (m *MockIOContext) WriteFull(oid string, data []byte) error
- type MockImage
Constants ¶
const (
SuccessfulMonStatusResponse = "{\"name\":\"mon0\",\"rank\":0,\"state\":\"leader\",\"election_epoch\":3,\"quorum\":[0],\"monmap\":{\"epoch\":1," +
"\"fsid\":\"22ae0d50-c4bc-4cfb-9cf4-341acbe35302\",\"modified\":\"2016-09-16 04:21:51.635837\",\"created\":\"2016-09-16 04:21:51.635837\"," +
"\"mons\":[{\"rank\":0,\"name\":\"mon0\",\"addr\":\"10.37.129.87:6790\"}]}}"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockConnection ¶
type MockConnection struct { MockOpenIOContext func(pool string) (client.IOContext, error) MockMonCommand func(args []byte) (buffer []byte, info string, err error) }
/////////////////////////////////////////////////////////// implement the interface for connecting to the ceph cluster ///////////////////////////////////////////////////////////
func (*MockConnection) Connect ¶
func (m *MockConnection) Connect() error
func (*MockConnection) MonCommand ¶
func (m *MockConnection) MonCommand(args []byte) (buffer []byte, info string, err error)
func (*MockConnection) MonCommandWithInputBuffer ¶
func (m *MockConnection) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error)
func (*MockConnection) OpenIOContext ¶
func (m *MockConnection) OpenIOContext(pool string) (client.IOContext, error)
func (*MockConnection) PingMonitor ¶
func (m *MockConnection) PingMonitor(id string) (string, error)
func (*MockConnection) ReadConfigFile ¶
func (m *MockConnection) ReadConfigFile(path string) error
func (*MockConnection) Shutdown ¶
func (m *MockConnection) Shutdown()
type MockConnectionFactory ¶
type MockConnectionFactory struct { Conn *MockConnection Fsid string SecretKey string }
/////////////////////////////////////////////////////////// implement the interface for generating ceph connections ///////////////////////////////////////////////////////////
func (*MockConnectionFactory) NewConnWithClusterAndUser ¶
func (m *MockConnectionFactory) NewConnWithClusterAndUser(clusterName string, userName string) (client.Connection, error)
func (*MockConnectionFactory) NewFsid ¶
func (m *MockConnectionFactory) NewFsid() (string, error)
func (*MockConnectionFactory) NewSecretKey ¶
func (m *MockConnectionFactory) NewSecretKey() (string, error)
type MockIOContext ¶
type MockIOContext struct { MockGetImageNames func() (names []string, err error) MockGetImage func(name string) client.Image MockCreateImage func(name string, size uint64, order int, args ...uint64) (image client.Image, err error) }
/////////////////////////////////////////////////////////// implement the interface for the ceph io context ///////////////////////////////////////////////////////////
func (*MockIOContext) CreateImage ¶
func (*MockIOContext) GetImageNames ¶
func (m *MockIOContext) GetImageNames() (names []string, err error)
func (*MockIOContext) Pointer ¶
func (m *MockIOContext) Pointer() uintptr