region

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package region provides region context functionalities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentStatus

type DeploymentStatus string

DeploymentStatus holds the region deployment status

const (
	Success DeploymentStatus = "Success"
	Failed  DeploymentStatus = "Failed"
)

Possible deployment statuses

type Manager

type Manager interface {
	// ListRegionContexts lists all the regions in tkg config file
	ListRegionContexts() ([]RegionContext, error)
	// SaveRegionContext saves a new region object into the tkg config file,
	// Errors will be returned if a region with same name and context already exists
	SaveRegionContext(region RegionContext) error
	// UpsertRegionContext updates region context object  if already exists,
	// else saves the new region object into the tkg config file
	UpsertRegionContext(region RegionContext) error
	// DeleteRegionContext deletes all region info with the given cluster name, regardless of context
	DeleteRegionContext(clusterName string) error
	// SetCurrentContext sets current regional context into tkg config file
	SetCurrentContext(clusterName string, contextName string) error
	// GetCurrentContext gets current regional context from tkg config file
	GetCurrentContext() (RegionContext, error)
}

Manager manages tkg regions

func New

func New(tkgConfigPath string) (Manager, error)

New creates regional manager

type ManagerFactory

type ManagerFactory interface {
	CreateManager(configPath string) (Manager, error)
}

ManagerFactory provides interface for region manager factory

func NewFactory

func NewFactory() ManagerFactory

NewFactory creates new manager factory

type RegionContext

type RegionContext struct {
	ClusterName      string           `yaml:"name" json:"name"`
	ContextName      string           `yaml:"context" json:"context"`
	SourceFilePath   string           `yaml:"file" json:"file"`
	Status           DeploymentStatus `yaml:"status" json:"status"`
	IsCurrentContext bool             `yaml:"isCurrentContext" json:"isCurrentContext"`
}

RegionContext holds the region context

Jump to

Keyboard shortcuts

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