manifest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package manifest provides type-safe FTL manifest operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	Command string   `yaml:"command" json:"command"`
	Workdir string   `yaml:"workdir,omitempty" json:"workdir,omitempty"`
	Watch   []string `yaml:"watch,omitempty" json:"watch,omitempty"`
}

BuildConfig represents build configuration

type Component

type Component struct {
	ID        string            `yaml:"id" json:"id"`
	Source    interface{}       `yaml:"source" json:"source"` // Can be string or SourceRegistry
	Build     *BuildConfig      `yaml:"build,omitempty" json:"build,omitempty"`
	Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty"`
}

Component represents a component in the manifest

func (Component) MarshalJSON

func (c Component) MarshalJSON() ([]byte, error)

MarshalJSON implements custom JSON marshaling for Component

func (Component) MarshalYAML

func (c Component) MarshalYAML() (interface{}, error)

MarshalYAML implements custom YAML marshaling for Component

func (*Component) UnmarshalJSON

func (c *Component) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling for Component

func (*Component) UnmarshalYAML

func (c *Component) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling for Component

type Manifest

type Manifest struct {
	Name        string                 `yaml:"name" json:"name"`
	Version     string                 `yaml:"version,omitempty" json:"version,omitempty"`
	Description string                 `yaml:"description,omitempty" json:"description,omitempty"`
	Access      string                 `yaml:"access,omitempty" json:"access,omitempty"`
	Auth        *validation.AuthConfig `yaml:"auth,omitempty" json:"auth,omitempty"`
	Components  []Component            `yaml:"components,omitempty" json:"components,omitempty"`
	Variables   map[string]string      `yaml:"variables,omitempty" json:"variables,omitempty"`
}

Manifest represents an FTL application manifest

func Load

func Load(path string) (*Manifest, error)

Load reads and parses an FTL manifest file (supports both YAML and JSON)

func LoadAuto

func LoadAuto() (*Manifest, error)

LoadAuto tries to load ftl.yaml or ftl.json automatically

func (*Manifest) AddComponent

func (m *Manifest) AddComponent(comp Component) error

AddComponent adds a new component to the manifest

func (*Manifest) FindComponent

func (m *Manifest) FindComponent(id string) (*Component, int)

FindComponent finds a component by ID

func (*Manifest) RemoveComponent

func (m *Manifest) RemoveComponent(id string) error

RemoveComponent removes a component by ID

func (*Manifest) Save

func (m *Manifest) Save(path string) error

Save writes the manifest to a file (format determined by extension)

func (*Manifest) SaveAuto

func (m *Manifest) SaveAuto() error

SaveAuto saves to the appropriate file (ftl.yaml or ftl.json)

type SourceRegistry

type SourceRegistry struct {
	Registry string `yaml:"registry" json:"registry"`
	Package  string `yaml:"package" json:"package"`
	Version  string `yaml:"version" json:"version"`
}

SourceRegistry represents a registry source

func ParseRegistrySource

func ParseRegistrySource(registry string) (*SourceRegistry, error)

ParseRegistrySource parses a registry string into a SourceRegistry Format: registry/namespace:package@version

Jump to

Keyboard shortcuts

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