Help us shape the future of Go! Take the 2026 Go Developer Survey

recipes

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package recipes is a small HTTP client for the SimpleDeploy community recipes catalog. The catalog is a static JSON index plus per-recipe compose.yml/README.md files served from GitHub Pages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(c *Client, ttl time.Duration) *Cache

func (*Cache) Client

func (c *Cache) Client() *Client

Client returns the underlying HTTP client (used by API handlers to fetch per-recipe sub-resources without re-implementing host whitelisting).

func (*Cache) Index

func (c *Cache) Index(ctx context.Context) (*Index, error)

func (*Cache) Invalidate

func (c *Cache) Invalidate()

type Client

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

func NewClient

func NewClient(indexURL string, timeout time.Duration) *Client

func (*Client) FetchIndex

func (c *Client) FetchIndex(ctx context.Context) (*Index, error)

func (*Client) FetchText

func (c *Client) FetchText(ctx context.Context, rawURL string) (string, error)

FetchText fetches a sub-resource (compose.yml, README.md). Refuses URLs outside the index host so a malicious index cannot make us fetch arbitrary internal endpoints.

type Index

type Index struct {
	SchemaVersion int      `json:"schema_version"`
	GeneratedAt   string   `json:"generated_at"`
	Recipes       []Recipe `json:"recipes"`
}

type Recipe

type Recipe struct {
	ID                     string   `json:"id"`
	Name                   string   `json:"name"`
	Icon                   string   `json:"icon,omitempty"`
	Category               string   `json:"category"`
	Description            string   `json:"description"`
	Tags                   []string `json:"tags,omitempty"`
	Author                 string   `json:"author,omitempty"`
	Homepage               string   `json:"homepage,omitempty"`
	ComposeURL             string   `json:"compose_url"`
	ReadmeURL              string   `json:"readme_url"`
	ScreenshotURL          string   `json:"screenshot_url,omitempty"`
	SchemaVersion          int      `json:"schema_version,omitempty"`
	MinSimpleDeployVersion string   `json:"min_simpledeploy_version,omitempty"`
}

Jump to

Keyboard shortcuts

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