sdl

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 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 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 `json:"path" yaml:"path"`
	Message string `json:"message" yaml:"message"`
	Hint    string `json:"hint,omitempty" yaml:"hint,omitempty"`
}

Issue is a single validation or lint finding.

type Options

type Options struct {
	Name         string
	Image        string
	Port         *int
	As           *int
	CPU          string
	Architecture 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    `json:"valid" yaml:"valid"`
	Services int     `json:"services" yaml:"services"`
	Groups   int     `json:"groups" yaml:"groups"`
	Errors   []Issue `json:"errors" yaml:"errors"`
	Warnings []Issue `json:"warnings" yaml:"warnings"`
}

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