sdl

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sdl implements the transport-independent `akt sdl` command group: scaffold listing, SDL generation, and offline validation. Everything runs locally — no context, keyring, or RPC endpoint is required, so the group declares no capability requirements.

The scaffold shapes are ported from console-axi's sdl/templates (registry.ts, common.ts, web.ts, gpu.ts, multi-service.ts, ip-lease.ts).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() *cobra.Command

Commands returns the `akt sdl` command group. The group is transport- independent: scaffolding and validation run entirely locally, so no context, keyring, or RPC endpoint is required and no capability annotations are declared.

func Marshal

func Marshal(doc *yaml.Node) ([]byte, error)

Marshal renders a scaffold document as YAML with 2-space indentation.

func ScaffoldNames

func ScaffoldNames() []string

ScaffoldNames returns the registry names in order.

Types

type Issue

type Issue struct {
	Path    string
	Message string
	Hint    string
}

Issue is a single validation or lint finding.

type Options

type Options struct {
	Name     string
	Image    string
	Port     *int
	As       *int
	CPU      string
	Memory   string
	Storage  string
	Count    *int
	Price    *int // max price per block, in uact
	Env      []string
	GPU      *int
	GPUModel string
}

Options are the generation parameters for `akt sdl init`. These are not positional-argument twins: every field is an optional knob with a per-scaffold default, so `akt sdl init <scaffold>` with no flags always produces a deployable SDL. Pointer fields distinguish "flag not set" from an explicit zero.

type Result

type Result struct {
	Valid    bool
	Services int
	Groups   int
	Errors   []Issue
	Warnings []Issue
}

Result is the outcome of validating one SDL document.

func Validate

func Validate(data []byte) Result

Validate parses an SDL document with pkg.akt.dev/go/sdl — the same parser and schema/relational validation used by `akt deploy` and the chain tx commands — then applies the local lint rules ported from console-axi (see lint.go). Parse failures and unpinned images are errors; on-chain pricing denoms are warnings. It never panics and collects every issue it can find.

type Scaffold

type Scaffold struct {
	Name        string
	Description string
	// Params lists the flags that meaningfully affect this scaffold,
	// shown by `akt sdl scaffolds`.
	Params []string
	// Build assembles the SDL document as a yaml.Node tree so that field
	// order is stable and follows SDL conventions (version, services,
	// profiles, deployment).
	Build func(o Options) *yaml.Node
}

Scaffold is one built-in SDL shape `akt sdl init` can generate.

func Lookup

func Lookup(name string) *Scaffold

Lookup returns the scaffold with the given name, or nil if none exists.

func Scaffolds

func Scaffolds() []Scaffold

Scaffolds returns the built-in scaffolds in registry order.

Jump to

Keyboard shortcuts

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