export

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: 6 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.

* 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 Factories = map[string]Factory{}

Factories store all registered Exporter Creator

Functions

func Add

func Add(typ string, f Factory)

Add register a Exporter Factory

Types

type AllResult

type AllResult struct {
	StartTime   time.Time
	EndTime     time.Time
	Statistics  map[diagnose.HealthyLevel]int
	Diagnostics []*DiagnosticResultItem
}

AllResult just collect diagnostic results and progress

func NewAllResult

func NewAllResult() *AllResult

NewAllResult return a new AllResult

func (*AllResult) AddDiagnosticResultItem

func (r *AllResult) AddDiagnosticResultItem(d *DiagnosticResultItem)

AddDiagnosticResultItem add a diagnostic resultItem to AllResult

func (*AllResult) Marshal

func (r *AllResult) Marshal() ([]byte, error)

Marshal make AllResult become json

func (*AllResult) UnMarshal

func (r *AllResult) UnMarshal(data []byte) error

UnMarshal init AllResult from a json

type DiagnosticResultItem

type DiagnosticResultItem struct {
	StartTime  time.Time
	EndTime    time.Time
	Catalogue  diagnose.Catalogue
	Type       string
	Name       string
	Desc       translate.Message
	Results    []*diagnose.Result
	Statistics map[diagnose.HealthyLevel]int
}

DiagnosticResultItem collect one diagnostic and it's results

func NewDiagnosticResultItem

func NewDiagnosticResultItem(dia diagnose.Diagnostic) *DiagnosticResultItem

NewDiagnosticResultItem return a new DiagnosticResultItem according to a Diagnostic

func (*DiagnosticResultItem) AddResult

func (d *DiagnosticResultItem) AddResult(r *diagnose.Result)

type Exporter

type Exporter interface {
	// Complete check and complete config items
	Complete() error
	// Meta return core attributes
	Meta() MetaData
	// Export export result
	Export(ctx context.Context, result *AllResult) error
}

Exporter export all steps and results with special way or special format

type Factory

type Factory struct {
	// Creator is a factory function to create Exporter
	Creator func(d *MetaData) Exporter
	// SupportedClouds indicate what cloud providers will be supported of this exporter
	SupportedClouds []string
}

Factory create a new Exporter

type History

type History struct {
	Records []*HistoryItem
}

func (*History) Marshal

func (h *History) Marshal() ([]byte, error)

Marshal make History become json

func (*History) UnMarshal

func (h *History) UnMarshal(data []byte) error

UnMarshal init History from a json

type HistoryItem

type HistoryItem struct {
	ID       string
	Overview AllResult
}

type MetaData

type MetaData struct {
	plugins.MetaData
}

MetaData contains core attributes of a Exporter

func (*MetaData) Meta

func (m *MetaData) Meta() MetaData

Meta return core MetaData this function can be use for struct implement Exporter interface

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