analysis

package
v0.0.0-...-4f28e87 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package analysis analyses schemas and creates comparison.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyser

type Analyser struct {
	// The cluster apps handed over to the agent.
	ClusterApps []ClusterApp

	// Schemas holds the full schema information in the original hierarchical
	// form. Map key is the provider name.
	Schemas map[string]*jsonschema.Schema

	// FlattenedSchema holds a flattened schema where all property names
	// are brought into a path like `/main/sub/subsub`.
	// Top level map key is the provider name.
	// Second level map key is the property name in path form.
	FlattenedSchema map[string]map[string]*jsonschema.Schema
}

Analyser is the agent that performs comparison and analysis on the schemas.

func New

func New(clusterApps []ClusterApp) (*Analyser, error)

func (*Analyser) Features

func (a *Analyser) Features() map[string][]string

Return "features" found in all schemas.

A feature is a unique combination of the JSON schema capabilities used.

func (*Analyser) HierarchicalKeys

func (a *Analyser) HierarchicalKeys() (keys []string)

Returns a list of all hierarchical property keys from all schemas.

func (*Analyser) Keys

func (a *Analyser) Keys(provider string) []string

Return keys of the provider's schema

func (*Analyser) MergedSchemas

func (a *Analyser) MergedSchemas() map[string]map[string]ProviderPropertySummary

MergedSchemas returns a map of properties occuring over all analysed schemas, with the list of providers and additional info as their value.

func (*Analyser) Providers

func (a *Analyser) Providers() (providers []string)

Providers returns the list of provider names in the order of definition.

type ClusterApp

type ClusterApp struct {
	// User-friendly name of the Cluster API infrastructure provider.
	ProviderName string

	// URL of the GitHub repo landing page.
	RepositoryURL string

	// URL of the schema file in JSON for download.
	SchemaURL string
}

ClusterApp holds information on a Giant Swarm cluster app for a Cluster API provider.

type PropertyDetails

type PropertyDetails struct {
	Key             string
	KeyHierarchical string
	Types           []string
	DefaultValue    string
}

PropertyDetails is an extract of information regarding a single property in a schema.

type ProviderPropertySummary

type ProviderPropertySummary struct {
	Types       []string
	Title       string
	Description string
}

Jump to

Keyboard shortcuts

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