Documentation
¶
Overview ¶
Copyright 2021 TiKV Project Authors.
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 2021 TiKV Project Authors.
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 2021 TiKV Project Authors.
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
- func AllOf(s interface{}, p func(int) bool) bool
- func AnyOf(s interface{}, p func(int) bool) bool
- func NoneOf(s interface{}, p func(int) bool) bool
- type CloudOperator
- func (c *CloudOperator) Back(version string) error
- func (c *CloudOperator) Check() bool
- func (c *CloudOperator) List() (map[string][]string, error)
- func (c *CloudOperator) Remove(version string) error
- func (c *CloudOperator) Restore(version string) error
- func (c *CloudOperator) Start() error
- func (c *CloudOperator) Stop() error
- type Operator
Constants ¶
const ( TiDB component = iota PD TiKV )
Flags for component.
const ( BaseDir = "/var/lib/" ParamLen = 8 MaxRetry = 5 // DebugLabel is the label for debug. DebugLabel = "runmode" DebugValue = "debug" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudOperator ¶
type CloudOperator struct {
// contains filtered or unexported fields
}
CloudOperator is the interface for cloud operator.
func NewCloudOperator ¶
func NewCloudOperator(namespace, conf string, ctx context.Context) *CloudOperator
NewCloudOperator creates a cloud operator.
func (*CloudOperator) Back ¶
func (c *CloudOperator) Back(version string) error
Back backs up all the components.
func (*CloudOperator) Check ¶
func (c *CloudOperator) Check() bool
func (*CloudOperator) List ¶
func (c *CloudOperator) List() (map[string][]string, error)
List returns all the backup version of the component in one cluster.
func (*CloudOperator) Remove ¶
func (c *CloudOperator) Remove(version string) error
func (*CloudOperator) Restore ¶
func (c *CloudOperator) Restore(version string) error
Restore restores all the components from backup directory.
func (*CloudOperator) Start ¶
func (c *CloudOperator) Start() error
Start starts all the components.
func (*CloudOperator) Stop ¶
func (c *CloudOperator) Stop() error
Stop stops all the pods of the component and will enter debug mode.
type Operator ¶
type Operator interface { // Start remove debug annotation and starts all pods Start() error // Stop stops all debugging pods Stop() error Back(version string) error // Restore Restore(version string) error // List return all components versions // K: pod.Name V: version list List() (map[string][]string, error) Check() bool Remove(version string) error }