coordinate

package
v0.0.0-...-6b231d8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 7 Imported by: 0

Documentation

Overview

* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. 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 * * https://opensource.org/licenses/Apache-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 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

View Source
var Creators = map[string]Creator{}

Creators store all registered Coordinator Creator

Functions

func Add

func Add(typ string, creator Creator)

Add register a Coordinator Creator

Types

type Coordinator

type Coordinator interface {
	// Complete check and complete config items
	Complete() error
	// AddDiagnostic add a diagnostic to Coordinator
	AddDiagnostic(dia diagnose.Diagnostic)
	// AddExporter add a Exporter to Coordinator
	AddExporter(exporter export.Exporter)
	// Run will do all diagnostics, evaluations, then export it by exporters
	Run(ctx context.Context) error
	// Progress return the coordination progress
	// if coordination has not start, an nil will be returned
	Progress() *plugins.Progress
}

Coordinator knows how to coordinate diagnostics,exporters,evaluators

type Creator

type Creator func(logger logger.Logger, cls cluster.Cluster, st store.Store) Coordinator

Creator is a factory to create a Coordinator

type FakeCoordinator

type FakeCoordinator struct {
	RunFunc func(ctx context.Context) error
}

func (*FakeCoordinator) AddDiagnostic

func (f *FakeCoordinator) AddDiagnostic(dia diagnose.Diagnostic)

AddDiagnostic add a diagnostic to Coordinator

func (*FakeCoordinator) AddExporter

func (f *FakeCoordinator) AddExporter(exporter export.Exporter)

AddExporter add a Exporter to Coordinator

func (*FakeCoordinator) Complete

func (f *FakeCoordinator) Complete() error

Complete check and complete config items

func (*FakeCoordinator) Progress

func (f *FakeCoordinator) Progress() *plugins.Progress

func (*FakeCoordinator) Run

func (f *FakeCoordinator) Run(ctx context.Context) error

Run will do all diagnostics, evaluations, then export it by exporters

Directories

Path Synopsis
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.

Jump to

Keyboard shortcuts

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