config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config defines the FTL configuration schema This is used both locally and for deployments

Index

Constants

View Source
const (
	DefaultVersion = "0.1.0"

	// Access control modes
	AccessControlPublic  = "public"
	AccessControlPrivate = "private"
	AccessControlOrg     = "org"
	AccessControlCustom  = "custom"

	// Trigger types
	TriggerTypeHTTP  = "http"
	TriggerTypeRedis = "redis"

	// Executor types
	ExecutorTypeSpin = "spin"
	ExecutorTypeWagi = "wagi"
)

Default values

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationConfig

type ApplicationConfig struct {
	Name        string   `yaml:"name" json:"name"`
	Version     string   `yaml:"version,omitempty" json:"version,omitempty"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Authors     []string `yaml:"authors,omitempty" json:"authors,omitempty"`
}

ApplicationConfig defines the application metadata

type AuthorizerConfig

type AuthorizerConfig struct {
	Enabled       bool     `yaml:"enabled" json:"enabled"`
	Component     string   `yaml:"component,omitempty" json:"component,omitempty"`           // Override default authorizer
	AccessControl string   `yaml:"access_control,omitempty" json:"access_control,omitempty"` // public, private, org, custom
	JWTIssuer     string   `yaml:"jwt_issuer,omitempty" json:"jwt_issuer,omitempty"`
	JWTAudience   string   `yaml:"jwt_audience,omitempty" json:"jwt_audience,omitempty"`
	AllowedRoles  []string `yaml:"allowed_roles,omitempty" json:"allowed_roles,omitempty"`
	OrgID         string   `yaml:"org_id,omitempty" json:"org_id,omitempty"`
}

AuthorizerConfig defines MCP authorizer configuration

type BuildConfig

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

BuildConfig defines build configuration for a component

type ComponentConfig

type ComponentConfig struct {
	ID                   string            `yaml:"id" json:"id"`
	Source               interface{}       `yaml:"source" json:"source"` // Can be string or map for different source types
	Description          string            `yaml:"description,omitempty" json:"description,omitempty"`
	Build                *BuildConfig      `yaml:"build,omitempty" json:"build,omitempty"`
	Variables            map[string]string `yaml:"variables,omitempty" json:"variables,omitempty"`
	Files                []FileMount       `yaml:"files,omitempty" json:"files,omitempty"`
	AllowedOutboundHosts []string          `yaml:"allowed_outbound_hosts,omitempty" json:"allowed_outbound_hosts,omitempty"`
	AllowedHTTPHosts     []string          `yaml:"allowed_http_hosts,omitempty" json:"allowed_http_hosts,omitempty"`
	KeyValueStores       []string          `yaml:"key_value_stores,omitempty" json:"key_value_stores,omitempty"`
	SQLiteDatabases      []string          `yaml:"sqlite_databases,omitempty" json:"sqlite_databases,omitempty"`
	AIModels             []string          `yaml:"ai_models,omitempty" json:"ai_models,omitempty"`
}

ComponentConfig defines a component in the application

func (*ComponentConfig) IsLocalSource

func (c *ComponentConfig) IsLocalSource() bool

IsLocalSource returns true if the source is a local file path

func (*ComponentConfig) IsRegistrySource

func (c *ComponentConfig) IsRegistrySource() bool

IsRegistrySource returns true if the source is a registry reference

type ComponentReference

type ComponentReference struct {
	ID          string `json:"id"`           // Component ID from config
	RegistryURI string `json:"registry_uri"` // Full registry URI
	Digest      string `json:"digest"`       // Content digest
}

ComponentReference provides registry information for a pushed component

type DeploymentRequest

type DeploymentRequest struct {
	Config      FTLConfig            `json:"config"`
	Components  []ComponentReference `json:"components"`
	Environment string               `json:"environment,omitempty"`
}

DeploymentRequest represents a deployment request to the platform This combines the FTL config with registry references for pushed components

type DeploymentResponse

type DeploymentResponse struct {
	DeploymentID string    `json:"deployment_id"`
	Status       string    `json:"status"`
	Message      string    `json:"message,omitempty"`
	AppURL       string    `json:"app_url,omitempty"`
	CreatedAt    time.Time `json:"created_at"`
}

DeploymentResponse represents the platform's response to a deployment request

type ExecutorConfig

type ExecutorConfig struct {
	Type string `yaml:"type,omitempty" json:"type,omitempty"` // spin, wagi
}

ExecutorConfig defines the executor for a trigger

type FTLConfig

type FTLConfig struct {
	Application ApplicationConfig `yaml:"application" json:"application"`
	Components  []ComponentConfig `yaml:"components,omitempty" json:"components,omitempty"`
	Triggers    []TriggerConfig   `yaml:"triggers,omitempty" json:"triggers,omitempty"`
	Variables   map[string]string `yaml:"variables,omitempty" json:"variables,omitempty"`
	MCP         *MCPConfig        `yaml:"mcp,omitempty" json:"mcp,omitempty"`
}

FTLConfig represents the top-level FTL configuration This is the source of truth for both local development and platform deployments

func (*FTLConfig) SetDefaults

func (c *FTLConfig) SetDefaults()

SetDefaults sets default values for optional fields

func (*FTLConfig) Validate

func (c *FTLConfig) Validate() error

Validate performs basic validation on the FTL config

type FileMount

type FileMount struct {
	Source      string `yaml:"source" json:"source"`
	Destination string `yaml:"destination" json:"destination"`
}

FileMount defines a file mount for a component

type GatewayConfig

type GatewayConfig struct {
	Enabled   bool   `yaml:"enabled" json:"enabled"`
	Component string `yaml:"component,omitempty" json:"component,omitempty"` // Override default gateway
}

GatewayConfig defines MCP gateway configuration

type MCPConfig

type MCPConfig struct {
	Gateway    *GatewayConfig    `yaml:"gateway,omitempty" json:"gateway,omitempty"`
	Authorizer *AuthorizerConfig `yaml:"authorizer,omitempty" json:"authorizer,omitempty"`
}

MCPConfig defines MCP-specific configuration

type TriggerConfig

type TriggerConfig struct {
	Type      string          `yaml:"type" json:"type"` // http, redis
	Component string          `yaml:"component" json:"component"`
	Route     string          `yaml:"route,omitempty" json:"route,omitempty"`     // For HTTP triggers
	Channel   string          `yaml:"channel,omitempty" json:"channel,omitempty"` // For Redis triggers
	Executor  *ExecutorConfig `yaml:"executor,omitempty" json:"executor,omitempty"`
}

TriggerConfig defines a trigger for a component

Jump to

Keyboard shortcuts

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