results

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package results provide types and methods used to assemble the results of deprecated objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeletedAPI

type DeletedAPI struct {
	Group   string `json,yaml:"group,omitempty"`
	Kind    string `json,yaml:"kind,omitempty"`
	Version string `json,yaml:"version,omitempty"`
	// TODO: What is this boolean for? All APIs here aren't already marked as Deleted?
	Deleted bool   `json,yaml:"deleted,omitempty"`
	Items   []Item `json,yaml:"deleted_items,omitempty"`
}

DeletedAPI definition of an API

type DeprecatedAPI

type DeprecatedAPI struct {
	Description string `json,yaml:"description,omitempty"`
	Group       string `json,yaml:"group,omitempty"`
	Kind        string `json,yaml:"kind,omitempty"`
	Version     string `json,yaml:"version,omitempty"`
	// TODO: What is this boolean for? All APIs here aren't already marked as Deprecated?
	Deprecated bool   `json,yaml:"deprecated,omitempty"`
	Items      []Item `json,yaml:"deprecated_items,omitempty"`
}

DeprecatedAPI definition of an API

type Item

type Item struct {
	Scope      string `json,yaml:"scope,omitempty"`
	ObjectName string `json,yaml:"objectname,omitempty"`
	Namespace  string `json,yaml:"namespace,omitempty"`
	Location   string `json:"location,omitempty" yaml:"location,omitempty"`
}

Item definition of the Items inside a deprecated API

func ListObjects

func ListObjects(items []unstructured.Unstructured) (deprecatedItems []Item)

ListObjects is a generic function that receives unstructured Kubernetes objects and convert to deprecatedItem to be used later in the results

type Result

type Result struct {
	DeprecatedAPIs []ResultItem `json,yaml:"deprecated_apis,omitempty"`
	DeletedAPIs    []ResultItem `json,yaml:"deleted_apis,omitempty"`
}

Result to show final user

type ResultItem added in v1.5.0

type ResultItem struct {
	Group       string `json,yaml:"group,omitempty"`
	Kind        string `json,yaml:"kind,omitempty"`
	Version     string `json,yaml:"version,omitempty"`
	Description string `json,yaml:"description,omitempty"`
	Items       []Item `json,yaml:"deleted_items,omitempty"`
}

func CreateItem added in v1.5.0

func CreateItem(group, version, kind string, items []Item) ResultItem

Jump to

Keyboard shortcuts

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