internal

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset = "\033[0m"
	ColorGreen = "\033[32m"
	ColorBold  = "\033[1m"
)

ANSI color codes

Variables

This section is empty.

Functions

func DryRun added in v1.2.0

func DryRun(filePath, tool string) ([]string, error)

DryRun checks the provided file for unused attributes based on a provider schema.

func GetRecommendations

func GetRecommendations(resourceType string, unusedAttrs []string, model string, tool string, prompt string, addr string) (string, error)

GetRecommendations generates recommendations based on unused attributes and a model.

func PrettyPrint added in v1.0.0

func PrettyPrint(markdownContent string)

PrettyPrint formats and displays markdown content with styled headers and recommendations. It applies custom styling using lipgloss and renders markdown using glamour. The output includes a header, the rendered markdown content, and a footer.

func Run

func Run(filePath, tool, model, prompt, addr string) error

func ValidateModel added in v0.3.0

func ValidateModel(model, addr string) error

ValidateModel checks if the specified model exists in Ollama

Types

type LlamaRequest

type LlamaRequest struct {
	Model  string `json:"model"`
	Prompt string `json:"prompt"`
	Stream bool   `json:"stream"`
}

LlamaRequest represents a request to the Llama API

type LlamaResponse

type LlamaResponse struct {
	Recommendations string `json:"response"`
}

LlamaResponse represents a response from the Llama API

type Model added in v0.3.0

type Model struct {
	Name string `json:"name"`
}

Model represents the structure of a model in the response

type ModelsResponse added in v0.3.0

type ModelsResponse struct {
	Models []Model `json:"models"`
}

ModelsResponse represents the structure of the response from /api/tags

type ProviderSchema

type ProviderSchema struct {
	ResourceTypes map[string]map[string]interface{}
}

func ExtractOpenTofuProviderSchema added in v0.6.0

func ExtractOpenTofuProviderSchema(rootDir string) (ProviderSchema, error)

func ExtractTerraformProviderSchema added in v0.6.0

func ExtractTerraformProviderSchema(rootDir string) (ProviderSchema, error)

type Resource

type Resource struct {
	Type       string
	Name       string
	Attributes map[string]string
}

func ParseConfigurationFile added in v0.6.0

func ParseConfigurationFile(file string) ([]Resource, error)

Directories

Path Synopsis
tui

Jump to

Keyboard shortcuts

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