recipe

package
v1.100.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRepoURL     = "https://api.github.com/repos/f1bonacc1/process-compose-recipes"
	DefaultTimeout     = 30 * time.Second
	RecipeMetadataFile = "recipe.yaml"
	ProcessComposeFile = "process-compose.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles communication with the recipe repository

func NewClient

func NewClient(repoURL string) *Client

NewClient creates a new recipe client

func (*Client) DownloadRecipe

func (c *Client) DownloadRecipe(ctx context.Context, recipeName string) (map[string][]byte, error)

DownloadRecipe downloads a complete recipe (metadata + process-compose.yaml)

func (*Client) GetRecipeIndex

func (c *Client) GetRecipeIndex(ctx context.Context) (*RecipeIndex, error)

GetRecipeIndex fetches and parses the recipe index

type GitHubContent

type GitHubContent struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Type        string `json:"type"`
	DownloadURL string `json:"download_url"`
	Content     string `json:"content"`
	Encoding    string `json:"encoding"`
}

GitHubContent represents a GitHub API content response

type LocalRecipe

type LocalRecipe struct {
	Recipe
	Path string `json:"path"`
}

LocalRecipe represents a recipe stored locally

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles local recipe operations

func NewManager

func NewManager(recipesDir string) *Manager

NewManager creates a new recipe manager

func (*Manager) GetRecipe

func (m *Manager) GetRecipe(recipeName string) (*LocalRecipe, error)

GetRecipe returns a specific local recipe

func (*Manager) GetRecipeContent

func (m *Manager) GetRecipeContent(recipeName string) ([]byte, error)

GetRecipeContent returns the content of a local recipe's process-compose.yaml file

func (*Manager) Initialize

func (m *Manager) Initialize() error

Initialize sets up the recipes directory and loads the local index

func (*Manager) ListLocalRecipes

func (m *Manager) ListLocalRecipes() ([]LocalRecipe, error)

ListLocalRecipes returns all locally installed recipes

func (*Manager) PullRecipe

func (m *Manager) PullRecipe(ctx context.Context, recipeName string, force bool, outputPath string) error

PullRecipe downloads and installs a recipe locally

func (*Manager) RemoveRecipe

func (m *Manager) RemoveRecipe(recipeName string) error

RemoveRecipe removes a local recipe

func (*Manager) SearchRecipes

func (m *Manager) SearchRecipes(ctx context.Context, filter SearchFilter) ([]Recipe, error)

SearchRecipes searches for recipes based on filter criteria

type Recipe

type Recipe struct {
	Name        string            `json:"name" yaml:"name"`
	Description string            `json:"description" yaml:"description"`
	Version     string            `json:"version" yaml:"version"`
	Author      string            `json:"author" yaml:"author"`
	Tags        []string          `json:"tags" yaml:"tags"`
	LastUpdated time.Time         `json:"last_updated" yaml:"last_updated"`
	MinVersion  string            `json:"min_version" yaml:"min_version"`                 // Minimum process-compose version required
	Variables   map[string]string `json:"variables,omitempty" yaml:"variables,omitempty"` // Default variable values
	Repository  string            `json:"repository" yaml:"repository"`
}

Recipe represents a process-compose recipe

type RecipeIndex

type RecipeIndex struct {
	Recipes     map[string]Recipe `json:"recipes" yaml:"recipes"`
	LastUpdated time.Time         `json:"last_updated" yaml:"last_updated"`
	Version     string            `json:"version" yaml:"version"`
}

RecipeIndex represents the index of all available recipes

type SearchFilter

type SearchFilter struct {
	Name        string
	Tags        []string
	Author      string
	Description string
}

SearchFilter contains criteria for searching recipes

Jump to

Keyboard shortcuts

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